Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various issues with ecto 3.12 #147

Merged
merged 10 commits into from
Aug 14, 2024
1 change: 1 addition & 0 deletions integration_test/constraints_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ defmodule Ecto.Integration.ConstraintsTest do
:ok
end

@tag :create_constraint
test "check constraint" do
changeset = Ecto.Changeset.change(%Constraint{}, fromm: 0, too: 10)
{:ok, _} = PoolRepo.insert(changeset)
Expand Down
141 changes: 80 additions & 61 deletions integration_test/test_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,85 @@ _ = Ecto.Adapters.SQLite3.storage_down(PoolRepo.config())
{:ok, _} = TestRepo.start_link()
{:ok, _pid} = PoolRepo.start_link()

excludes = [
:delete_with_join,
:right_join,

# SQLite does not have an array type
:array_type,
:transaction_isolation,
:insert_cell_wise_defaults,
:insert_select,

# sqlite does not support microsecond precision, only millisecond
:microsecond_precision,

# sqlite supports FKs, but does not return sufficient data
# for ecto to support matching on a given constraint violation name
# which is what most of the tests validate
:foreign_key_constraint,

# SQLite with DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1
# does not support using LIKE on BLOB types
:like_match_blob,

# SQLite will return a string for schemaless map types as
# Ecto does not have enough information to call the associated loader
# that converts the string JSON representaiton into a map
:map_type_schemaless,

# right now in lock_for_migrations() we do effectively nothing, this is because
# SQLite is single-writer so there isn't really a need for us to do anything.
# ecto assumes all implementing adapters need >=2 connections for migrations
# which is not true for SQLite
:lock_for_migrations,

# Migration we don't support
:prefix,
:add_column_if_not_exists,
:remove_column_if_exists,
:alter_primary_key,
:alter_foreign_key,
:assigns_id_type,
:modify_column,
:restrict,

# SQLite3 does not support the concat function
:concat,

# SQLite3 does not support placeholders
:placeholders,

# SQLite3 stores booleans as integers, causing Ecto's json_extract_path tests to fail
:json_extract_path,

# SQLite3 doesn't support specifying columns for ON DELETE SET NULL
:on_delete_nilify_column_list,

# not sure how to support this yet
:bitstring_type,

# sqlite does not have a duration type... yet
:duration_type,

# We don't support selected_as
:selected_as_with_group_by,
:selected_as_with_order_by,
:selected_as_with_order_by_expression,
:selected_as_with_having,

# Distinct with options not supported
:distinct_count,

# SQLite does not support anything except a single column in DISTINCT
:multicolumn_distinct,

# Values list
:values_list
]

ExUnit.configure(exclude: excludes)

# migrate the pool repo
case Ecto.Migrator.migrated_versions(PoolRepo) do
[] ->
Expand All @@ -71,64 +150,4 @@ end
Ecto.Adapters.SQL.Sandbox.mode(TestRepo, :manual)
Process.flag(:trap_exit, true)

ExUnit.start(
exclude: [
:delete_with_join,
:right_join,
# SQLite does not have an array type
:array_type,
:transaction_isolation,
:insert_cell_wise_defaults,
:insert_select,
# sqlite does not support microsecond precision, only millisecond
:microsecond_precision,
# sqlite supports FKs, but does not return sufficient data
# for ecto to support matching on a given constraint violation name
# which is what most of the tests validate
:foreign_key_constraint,
# SQLite with DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1
# does not support using LIKE on BLOB types
:like_match_blob,
# SQLite will return a string for schemaless map types as
# Ecto does not have enough information to call the associated loader
# that converts the string JSON representaiton into a map
:map_type_schemaless,

# right now in lock_for_migrations() we do effectively nothing, this is because
# SQLite is single-writer so there isn't really a need for us to do anything.
# ecto assumes all implementing adapters need >=2 connections for migrations
# which is not true for SQLite
:lock_for_migrations,

# Migration we don't support
:prefix,
:add_column_if_not_exists,
:remove_column_if_exists,
:alter_primary_key,
:alter_foreign_key,
:assigns_id_type,
:modify_column,
:restrict,

# SQLite3 does not support the concat function
:concat,
# SQLite3 does not support placeholders
:placeholders,
# SQLite3 stores booleans as integers, causing Ecto's json_extract_path tests to fail
:json_extract_path,
# SQLite3 doesn't support specifying columns for ON DELETE SET NULL
:on_delete_nilify_column_list,

# We don't support selected_as
:selected_as_with_group_by,
:selected_as_with_order_by,
:selected_as_with_order_by_expression,
:selected_as_with_having,

# Distinct with options not supported
:distinct_count,

# Values list
:values_list
]
)
ExUnit.start()
Loading
Loading