An Ecto SQLite3 adapter.
0

Configure Feed

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

update Ecto to v3.13 (#170)

* update Ecto to v3.13
* add identifier/1 support
* link identifier/1 in changelog
* pin ecto_sql to ~> 0.13.0
* drop :literal clause

authored by

ruslandoga and committed by
GitHub
(Jun 19, 2025, 3:21 PM -0500) 455bee6e a04c2493

+26 -5
+2
CHANGELOG.md
··· 6 6 project adheres to [Semantic Versioning][semver]. 7 7 8 8 ## Unreleased 9 + - added: Ecto [`identifier/1`](https://hexdocs.pm/ecto/Ecto.Query.API.html#identifier/1) support 10 + - changed: Bump (and restrict) Ecto to `3.13.0` 9 11 10 12 ## v0.19.0 11 13 - changed: Configurable encoding for `:map` and `:array`, allowing usage of SQLite's JSONB storage format.
+2 -2
mix.exs
··· 35 35 defp deps do 36 36 [ 37 37 {:decimal, "~> 1.6 or ~> 2.0"}, 38 - {:ecto_sql, "~> 3.12"}, 39 - {:ecto, "~> 3.12"}, 38 + {:ecto_sql, "~> 3.13.0"}, 39 + {:ecto, "~> 3.13.0"}, 40 40 {:exqlite, "~> 0.22"}, 41 41 {:ex_doc, "~> 0.27", only: [:dev], runtime: false}, 42 42 {:jason, ">= 0.0.0", only: [:dev, :test, :docs]},
+2 -2
mix.lock
··· 8 8 "decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"}, 9 9 "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, 10 10 "earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"}, 11 - "ecto": {:hex, :ecto, "3.12.5", "4a312960ce612e17337e7cefcf9be45b95a3be6b36b6f94dfb3d8c361d631866", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6eb18e80bef8bb57e17f5a7f068a1719fbda384d40fc37acb8eb8aeca493b6ea"}, 12 - "ecto_sql": {:hex, :ecto_sql, "3.12.1", "c0d0d60e85d9ff4631f12bafa454bc392ce8b9ec83531a412c12a0d415a3a4d0", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "aff5b958a899762c5f09028c847569f7dfb9cc9d63bdb8133bff8a5546de6bf5"}, 11 + "ecto": {:hex, :ecto, "3.13.1", "ebb11c2f0307ff62e8aaba57def59ad920a3cbd89d002b1118944cbf598c13c7", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d9ea5075a6f3af9cd2cdbabe8a0759eb73b485e981fd7c03014f79479ac85340"}, 12 + "ecto_sql": {:hex, :ecto_sql, "3.13.0", "a732428f38ce86612a2c34a1ea5d0a9642a5a71f044052007fd2f2e815707990", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.13.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5ce13085122a0871d93ea9ba1a886447d89c07f3b563e19e0b3dcdf201ed9fe9"}, 13 13 "elixir_make": {:hex, :elixir_make, "0.9.0", "6484b3cd8c0cee58f09f05ecaf1a140a8c97670671a6a0e7ab4dc326c3109726", [:mix], [], "hexpm", "db23d4fd8b757462ad02f8aa73431a426fe6671c80b200d9710caf3d1dd0ffdb"}, 14 14 "ex_doc": {:hex, :ex_doc, "0.37.3", "f7816881a443cd77872b7d6118e8a55f547f49903aef8747dbcb345a75b462f9", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "e6aebca7156e7c29b5da4daa17f6361205b2ae5f26e5c7d8ca0d3f7e18972233"}, 15 15 "exqlite": {:hex, :exqlite, "0.30.0", "92cd991fc7fcdf688718452bca5012ffa9015d333845d7661ee00c8256e80423", [:make, :mix], [{:cc_precompiler, "~> 0.1", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.8", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "3ed5800d1ccafc220d4a2e0bc7cf2c0e2f93456f03f73856158b474e010c792c"},
+10
test/ecto/integration/crud_test.exs
··· 282 282 assert account.id == account1.id 283 283 end 284 284 285 + test "can handle fragment identifier" do 286 + account1 = TestRepo.insert!(%Account{name: "Main"}) 287 + 288 + name = "name" 289 + query = from(a in Account, where: fragment("? = ?", identifier(^name), "Main")) 290 + 291 + assert [account] = TestRepo.all(query) 292 + assert account.id == account1.id 293 + end 294 + 285 295 test "can handle selected_as" do 286 296 TestRepo.insert!(%Account{name: "Main"}) 287 297 TestRepo.insert!(%Account{name: "Main"})
+1 -1
lib/ecto/adapters/sqlite3/connection.ex
··· 1372 1372 raise ArgumentError, "SQLite3 adapter does not support values lists" 1373 1373 end 1374 1374 1375 - defp expr({:literal, _, [literal]}, _sources, _query) do 1375 + defp expr({:identifier, _, [literal]}, _sources, _query) do 1376 1376 quote_name(literal) 1377 1377 end 1378 1378
+9
test/ecto/adapters/sqlite3/connection/select_test.exs
··· 166 166 assert ~s{SELECT s0."x" COLLATE "es_ES" FROM "schema" AS s0} == all(query) 167 167 end 168 168 169 + test "collating with identifier" do 170 + query = 171 + Schema 172 + |> select([r], fragment("? COLLATE ?", r.x, identifier(^"es_ES"))) 173 + |> plan() 174 + 175 + assert ~s{SELECT s0."x" COLLATE "es_ES" FROM "schema" AS s0} == all(query) 176 + end 177 + 169 178 test "fragment with a column and value specified" do 170 179 value = 13 171 180