{"id":13508908,"url":"https://github.com/jazzyb/sqlite_ecto","last_synced_at":"2026-02-18T22:02:12.517Z","repository":{"id":27981994,"uuid":"31475489","full_name":"jazzyb/sqlite_ecto","owner":"jazzyb","description":"SQLite3 adapter for Ecto","archived":false,"fork":false,"pushed_at":"2016-12-23T21:36:44.000Z","size":215,"stargazers_count":76,"open_issues_count":15,"forks_count":27,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-11-01T08:15:05.972Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jazzyb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-28T20:23:26.000Z","updated_at":"2025-04-17T06:03:23.000Z","dependencies_parsed_at":"2022-08-26T11:20:56.597Z","dependency_job_id":null,"html_url":"https://github.com/jazzyb/sqlite_ecto","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/jazzyb/sqlite_ecto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzyb%2Fsqlite_ecto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzyb%2Fsqlite_ecto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzyb%2Fsqlite_ecto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzyb%2Fsqlite_ecto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jazzyb","download_url":"https://codeload.github.com/jazzyb/sqlite_ecto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzyb%2Fsqlite_ecto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:01:00.333Z","updated_at":"2026-02-18T22:02:12.500Z","avatar_url":"https://github.com/jazzyb.png","language":"Elixir","readme":"Sqlite.Ecto [![Build Status](https://travis-ci.org/jazzyb/sqlite_ecto.svg?branch=master \"Build Status\")](https://travis-ci.org/jazzyb/sqlite_ecto)\n==========\n\n`Sqlite.Ecto` is a SQLite3 Adapter for Ecto.\n\nRead [the tutorial](https://github.com/jazzyb/sqlite_ecto/wiki/Basic-Sqlite.Ecto-Tutorial)\nfor a detailed example of how to setup and use a SQLite repo with Ecto, or\njust check-out the CliffsNotes in the sections below if you want to get\nstarted quickly.\n\n## Dependencies\n\n`Sqlite.Ecto` relies on [Sqlitex](https://github.com/mmmries/sqlitex) and\n[esqlite](https://github.com/mmzeeman/esqlite).  Since esqlite uses\nErlang NIFs, you will need a valid C compiler to build the library.\n\n## Example\n\nHere is an example usage:\n\n```elixir\n# In your config/config.exs file\nconfig :my_app, Repo,\n  adapter: Sqlite.Ecto,\n  database: \"ecto_simple.sqlite3\"\n\n# In your application code\ndefmodule Repo do\n  use Ecto.Repo,\n    otp_app: :my_app,\n    adapter: Sqlite.Ecto\nend\n\ndefmodule Weather do\n  use Ecto.Model\n\n  schema \"weather\" do\n    field :city     # Defaults to type :string\n    field :temp_lo, :integer\n    field :temp_hi, :integer\n    field :prcp,    :float, default: 0.0\n  end\nend\n\ndefmodule Simple do\n  import Ecto.Query\n\n  def sample_query do\n    query = from w in Weather,\n          where: w.prcp \u003e 0 or is_nil(w.prcp),\n         select: w\n    Repo.all(query)\n  end\nend\n```\n\n## Usage\n\nAdd `Sqlite.Ecto` as a dependency in your `mix.exs` file.\n\n```elixir\ndef deps do\n  [{:sqlite_ecto, \"~\u003e 1.0.0\"}]\nend\n```\n\nYou should also update your applications list to include both projects:\n```elixir\ndef application do\n  [applications: [:logger, :sqlite_ecto, :ecto]]\nend\n```\n\nTo use the adapter in your repo:\n```elixir\ndefmodule MyApp.Repo do\n  use Ecto.Repo,\n    otp_app: :my_app,\n    adapter: Sqlite.Ecto\nend\n```\n\n## Unsupported Ecto Constraints\n\nThe changeset functions\n[`foreign_key_constraint/3`](http://hexdocs.pm/ecto/Ecto.Changeset.html#foreign_key_constraint/3)\nand\n[`unique_constraint/3`](http://hexdocs.pm/ecto/Ecto.Changeset.html#unique_constraint/3)\nare not supported by `Sqlite.Ecto` because the underlying SQLite database does\nnot provide enough information when such constraints are violated to support\nthe features.\n\nNote that SQLite **does** support both unique and foreign key constraints via\n[`unique_index/3`](http://hexdocs.pm/ecto/Ecto.Migration.html#unique_index/3)\nand [`references/2`](http://hexdocs.pm/ecto/Ecto.Migration.html#references/2),\nrespectively.  When such constraints are violated, they will raise\n`Sqlite.Ecto.Error` exceptions.\n\n## Silently Ignored Options\n\nThere are a few Ecto options which `Sqlite.Ecto` silently ignores because\nSQLite does not support them and raising an error on them does not make sense:\n* Most column options will ignore `size`, `precision`, and `scale` constraints\n  on types because columns in SQLite have no types, and SQLite will not coerce\n  any stored value.  Thus, all \"strings\" are `TEXT` and \"numerics\" will have\n  arbitrary precision regardless of the declared column constraints.  The lone\n  exception to this rule are Decimal types which accept `precision` and\n  `scale` options because these constraints are handled in the driver\n  software, not the SQLite database.\n* If we are altering a table to add a `DATETIME` column with a `NOT NULL`\n  constraint, SQLite will require a default value to be provided.  The only\n  default value which would make sense in this situation is\n  `CURRENT_TIMESTAMP`; however, when adding a column to a table, defaults must\n  be constant values.  Therefore, in this situation the `NOT NULL` constraint\n  will be ignored so that a default value does not need to be provided.\n* When creating an index, `concurrently` and `using` values are silently\n  ignored since they do not apply to SQLite.\n","funding_links":[],"categories":["ORM and Datamapping"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazzyb%2Fsqlite_ecto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjazzyb%2Fsqlite_ecto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazzyb%2Fsqlite_ecto/lists"}