An Ecto SQLite3 adapter.
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix typos (#149)

Found via `typos --hidden --format brief`

authored by

Kian-Meng Ang and committed by
GitHub
(Aug 26, 2024, 10:46 AM -0500) 826b0529 78fb45f0

+84 -84
+3 -3
CHANGELOG.md
··· 62 62 63 63 ## v0.10.3 64 64 65 - - fixed: Handle unique cosntraint error formats. 66 - - changed: Updated depenendencies. 65 + - fixed: Handle unique constraint error formats. 66 + - changed: Updated dependencies. 67 67 68 68 ## v0.10.2 69 69 ··· 130 130 - added: `:time` decode support. 131 131 132 132 ## v0.7.1 133 - - fixed: Backport of default drops to `:restrict` are now backwards compatible with older versions of `ecto_sql`. We don't really have support for `drop index ... cascade` as it is not in the grammer of sqlite. 133 + - fixed: Backport of default drops to `:restrict` are now backwards compatible with older versions of `ecto_sql`. We don't really have support for `drop index ... cascade` as it is not in the grammar of sqlite. 134 134 135 135 ## v0.7.0 136 136 - changed: update dependencies to the latest.
+1 -1
README.md
··· 85 85 mix test 86 86 ``` 87 87 88 - Runing integration tests 88 + Running integration tests 89 89 90 90 ```sh 91 91 EXQLITE_INTEGRATION=true mix test
+1 -1
integration_test/test_helper.exs
··· 81 81 82 82 # SQLite will return a string for schemaless map types as 83 83 # Ecto does not have enough information to call the associated loader 84 - # that converts the string JSON representaiton into a map 84 + # that converts the string JSON representation into a map 85 85 :map_type_schemaless, 86 86 87 87 # right now in lock_for_migrations() we do effectively nothing, this is because
+1 -1
lib/ecto/adapters/sqlite3.ex
··· 124 124 125 125 ### Case sensitivity 126 126 127 - Case sensitivty for `LIKE` is off by default, and controlled by the `:case_sensitive_like` 127 + Case sensitivity for `LIKE` is off by default, and controlled by the `:case_sensitive_like` 128 128 option outlined above. 129 129 130 130 However, for equality comparison, case sensitivity is always _on_.
-76
test/ecto/adapters/sqlite3/connection/interesect_test.exs
··· 1 - defmodule Ecto.Adapters.SQLite3.Connection.IntersectTest do 2 - use ExUnit.Case, async: true 3 - 4 - import Ecto.Query 5 - import Ecto.Adapters.SQLite3.TestHelpers 6 - 7 - alias EctoSQLite3.Schemas.Schema 8 - 9 - test "intersect" do 10 - base_query = 11 - Schema 12 - |> select([r], r.x) 13 - |> order_by(fragment("rand")) 14 - |> offset(10) 15 - |> limit(5) 16 - 17 - intersect_query1 = 18 - Schema 19 - |> select([r], r.y) 20 - |> order_by([r], r.y) 21 - |> offset(20) 22 - |> limit(40) 23 - 24 - intersect_query2 = 25 - Schema 26 - |> select([r], r.z) 27 - |> order_by([r], r.z) 28 - |> offset(30) 29 - |> limit(60) 30 - 31 - query = 32 - base_query 33 - |> intersect(^intersect_query1) 34 - |> intersect(^intersect_query2) 35 - |> plan() 36 - 37 - assert all(query) == 38 - ~s{SELECT s0."x" FROM "schema" AS s0 } <> 39 - ~s{INTERSECT SELECT s0."y" FROM "schema" AS s0 ORDER BY s0."y" LIMIT 40 OFFSET 20 } <> 40 - ~s{INTERSECT SELECT s0."z" FROM "schema" AS s0 ORDER BY s0."z" LIMIT 60 OFFSET 30 } <> 41 - ~s{ORDER BY rand LIMIT 5 OFFSET 10} 42 - end 43 - 44 - test "intersect all is not supported" do 45 - base_query = 46 - Schema 47 - |> select([r], r.x) 48 - |> order_by(fragment("rand")) 49 - |> offset(10) 50 - |> limit(5) 51 - 52 - intersect_query1 = 53 - Schema 54 - |> select([r], r.y) 55 - |> order_by([r], r.y) 56 - |> offset(20) 57 - |> limit(40) 58 - 59 - intersect_query2 = 60 - Schema 61 - |> select([r], r.z) 62 - |> order_by([r], r.z) 63 - |> offset(30) 64 - |> limit(60) 65 - 66 - query = 67 - base_query 68 - |> intersect_all(^intersect_query1) 69 - |> intersect_all(^intersect_query2) 70 - |> plan() 71 - 72 - assert_raise Ecto.QueryError, fn -> 73 - all(query) 74 - end 75 - end 76 - end
+76
test/ecto/adapters/sqlite3/connection/intersect_test.exs
··· 1 + defmodule Ecto.Adapters.SQLite3.Connection.IntersectTest do 2 + use ExUnit.Case, async: true 3 + 4 + import Ecto.Query 5 + import Ecto.Adapters.SQLite3.TestHelpers 6 + 7 + alias EctoSQLite3.Schemas.Schema 8 + 9 + test "intersect" do 10 + base_query = 11 + Schema 12 + |> select([r], r.x) 13 + |> order_by(fragment("rand")) 14 + |> offset(10) 15 + |> limit(5) 16 + 17 + intersect_query1 = 18 + Schema 19 + |> select([r], r.y) 20 + |> order_by([r], r.y) 21 + |> offset(20) 22 + |> limit(40) 23 + 24 + intersect_query2 = 25 + Schema 26 + |> select([r], r.z) 27 + |> order_by([r], r.z) 28 + |> offset(30) 29 + |> limit(60) 30 + 31 + query = 32 + base_query 33 + |> intersect(^intersect_query1) 34 + |> intersect(^intersect_query2) 35 + |> plan() 36 + 37 + assert all(query) == 38 + ~s{SELECT s0."x" FROM "schema" AS s0 } <> 39 + ~s{INTERSECT SELECT s0."y" FROM "schema" AS s0 ORDER BY s0."y" LIMIT 40 OFFSET 20 } <> 40 + ~s{INTERSECT SELECT s0."z" FROM "schema" AS s0 ORDER BY s0."z" LIMIT 60 OFFSET 30 } <> 41 + ~s{ORDER BY rand LIMIT 5 OFFSET 10} 42 + end 43 + 44 + test "intersect all is not supported" do 45 + base_query = 46 + Schema 47 + |> select([r], r.x) 48 + |> order_by(fragment("rand")) 49 + |> offset(10) 50 + |> limit(5) 51 + 52 + intersect_query1 = 53 + Schema 54 + |> select([r], r.y) 55 + |> order_by([r], r.y) 56 + |> offset(20) 57 + |> limit(40) 58 + 59 + intersect_query2 = 60 + Schema 61 + |> select([r], r.z) 62 + |> order_by([r], r.z) 63 + |> offset(30) 64 + |> limit(60) 65 + 66 + query = 67 + base_query 68 + |> intersect_all(^intersect_query1) 69 + |> intersect_all(^intersect_query2) 70 + |> plan() 71 + 72 + assert_raise Ecto.QueryError, fn -> 73 + all(query) 74 + end 75 + end 76 + end
+1 -1
test/ecto/adapters/sqlite3/connection/to_constraints_test.exs
··· 1 - defmodule Ecto.Adapters.SQLite3.Connection.ToCosntraintsTest do 1 + defmodule Ecto.Adapters.SQLite3.Connection.ToConstraintsTest do 2 2 use ExUnit.Case, async: true 3 3 4 4 alias Ecto.Adapters.SQLite3.Connection
+1 -1
test/ecto/adapters/sqlite3/connection/windowing_test.exs
··· 98 98 ~s{ORDER BY s0."x")} == all(query) 99 99 end 100 100 101 - test "partition by ond order by over" do 101 + test "partition by one order by over" do 102 102 query = 103 103 Schema 104 104 |> select([r], count(r.x) |> over(partition_by: [r.x, r.z], order_by: r.x))