Exqlite.Connection.connect

You're seeing just the function connect, go back to Exqlite.Connection module for more information.

Initializes the Ecto Exqlite adapter.

For connection configurations we use the defaults that come with SQLite3, but we recommend which options to choose. We do not default to the recommended because we don't know what your environment is like.

Allowed options:

  • :database - The path to the database. In memory is allowed. You can use :memory or ":memory:" to designate that.
  • :journal_mode - Sets the journal mode for the sqlite connection. Can be one of the following :delete, :truncate, :persist, :memory, :wal, or :off. Defaults to :delete. It is recommended that you use :wal due to support for concurrent reads. Note: :wal does not mean concurrent writes.
  • :temp_store - Sets the storage used for temporary tables. Default is :default. Allowed values are :default, :file, :memory. It is recommended that you use :memory for storage.
  • :synchronous - Can be :extra, :full, :normal, or :off. Defaults to :normal.
  • :foreign_keys - Sets if foreign key checks should be enforced or not. Can be :on or :off. Default is :on.
  • :cache_size - Sets the cache size to be used for the connection. This is an odd setting as a positive value is the number of pages in memory to use and a negative value is the size in kilobytes to use. Default is -2000. It is recommended that you use -64000.
  • :cache_spill - The cache_spill pragma enables or disables the ability of the pager to spill dirty cache pages to the database file in the middle of a transaction. By default it is :on, and for most applications, it should remain so.
  • :case_sensitive_like
  • :auto_vacuum - Defaults to :none. Can be :none, :full or :incremental. Depending on the database size, :incremental may be beneficial.
  • :locking_mode - Defaults to :normal. Allowed values are :normal or :exclusive. See sqlite documenation for more information.
  • :secure_delete - Defaults to :off. If enabled, it will cause SQLite3 to overwrite records that were deleted with zeros.
  • :wal_auto_check_point - Sets the write-ahead log auto-checkpoint interval. Default is 1000. Setting the auto-checkpoint size to zero or a negative value turns auto-checkpointing off.
  • :busy_timeout - Sets the busy timeout in milliseconds for a connection. Default is 2000.
  • :chunk_size - The chunk size for bulk fetching. Defaults to 50.

For more information about the options above, see sqlite documenation