Changelog
0.2.0
Breaking Changes
-
API aligned with Ecto Repo conventions - This is a breaking change that simplifies the API to match
Ecto.Repo.all/2andEcto.Repo.one/2semantics.query_all/4now returns list directly (was{:ok, list})# Before{:ok, users} = SqlKit.query_all(Repo, "SELECT * FROM users")# Afterusers = SqlKit.query_all(Repo, "SELECT * FROM users")query_all!/4removed (usequery_all/4instead)# Beforeusers = SqlKit.query_all!(Repo, "SELECT * FROM users")# Afterusers = SqlKit.query_all(Repo, "SELECT * FROM users")query_one/4now returns result or nil directly (was{:ok, result | nil})# Before{:ok, user} = SqlKit.query_one(Repo, "SELECT * FROM users WHERE id = $1", [1]){:ok, nil} = SqlKit.query_one(Repo, "SELECT * FROM users WHERE id = $1", [999])# Afteruser = SqlKit.query_one(Repo, "SELECT * FROM users WHERE id = $1", [1])nil = SqlKit.query_one(Repo, "SELECT * FROM users WHERE id = $1", [999])query_one/4now raises on multiple results (was{:error, MultipleResultsError})# Before{:error, %SqlKit.MultipleResultsError{}} =SqlKit.query_one(Repo, "SELECT * FROM users")# After# Raises SqlKit.MultipleResultsErrorSqlKit.query_one(Repo, "SELECT * FROM users")File-based API follows same changes:
MyModule.query_all/3returns list directlyMyModule.query_all!/3removedMyModule.query_one/3returns result or nil, raises on multiple
Added
-
DuckDB support via
duckdbexdriverSqlKit.DuckDB.connect/2anddisconnect/1for direct connectionsSqlKit.DuckDB.Pool- NimblePool-based connection pool with supervision- File-based SQL support via
:backendoption (backend: {:duckdb, pool: PoolName}) - Automatic hugeint to integer conversion
- PostgreSQL-style
$1, $2, ...parameter placeholders
-
Prepared statement caching for DuckDB pools
- Automatic caching of prepared statements per connection
- Configurable via
:cacheoption (default: true)
-
Streaming support for DuckDB large result sets
SqlKit.DuckDB.stream!/3andstream_with_columns!/3for direct connectionsSqlKit.DuckDB.Pool.with_stream!/5andwith_stream_and_columns!/6for poolswith_stream!/3andwith_stream_and_columns!/4for file-based SQL modules
-
Pool tuning options
:timeoutoption for checkout operations (default: 5000ms)- Lazy connection initialization
- Documented pool behavior and configuration
0.1.0
- Initial release