This proc macro implements `Connection` and related traits for an enum
of connections for different database backends. This allows to easily
support multiple database systems at the same time. I've chosen to
implement this feature as a derive, instead of providing just one
`AnyConnection` enum with all diesel connection types, to allow third
party connection implementations to be used there as well.
* We reorder the changelog a bit to highlight important possibly
breaking changes
* We add the missing 1.4.x releases (copied from the 1.4.x branch)
* We add a note about the minimal supported rust version
Add Sqlite support for the `RETURNING` clause by leveraging
the implementation for Postgres. So this change is essentially
just adjusting the build system to enable the support if a
Sqlite version which supports the `RETURNING` clause [1] is
complied against.
The "insert record with returning" unit tests for Postgres
couldn't be re-used because Sqlite doesn't support batch insert.
Because those tests provide value for Postgres, new versions
for Sqlite have been created which don't use batch insert.
[1] https://sqlite.org/releaselog/3_35_0.html
`libsqlite3-sys` is built with the `bundled_bindings`
feature enabled which was introduced in commit [1]
which in turn is part of `libsqlite3-sys` 0.17.2.
Versions below 0.17.2 will hence fail to compile.
Therefore, tighten the minimum required version.
[1] c70d148542
The main motivation of this change is to allow third party backends like
diesel-oci to speciaize `QueryFragment` impls without using the unstable
`specialization` feature. This is done by introducing a new marker trait
`SqlDialect` that has an associated type for each specializable
`QueryFragment` impl.
Beside of that this allows us to fix a few long standing issues:
* `eq_any` can now use `= ANY()` on postgres
* We can now support batch inserts for sqlite as long as there is no
default value in the insert values
Fixes#2898Fixes#2694 (by deprecating the corresponding functions)
* Cache insert statments from queries, as those are safe to cache if the
query itself is safe to cache
* Add a way to directly insert from a statically sized array
* Decouple default values from insert expressions and allow to generate
insertable implementations that do not use the default values.
+ This unblocks real batch inserts on sqlite
+ This allows cache the prepared statements for insert from statically sized arrays as we know the size at compile time here
* Update the benchmarks to use the statically compile time variant.
Other implementations also use prepared statements here, so this is
just fair