An mssql Persister for SQL Server and Azure SQL? #294
nltgpeterskoglund
started this conversation in
Ideas
Replies: 1 comment
|
I have opened this as #295 in the meantime, so there is a concrete diff to look at rather than just a description. The scope question above still stands though - happy to close it and rework things here if you would rather it landed differently. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Would you be open to a
persister-mssqlmodule? It would bind to themssqlpackage, which covers SQL Server, Azure SQL Database and Azure SQL Managed
Instance in one go, and would follow the
persister-pgshape: you pass in aConnectionPoolyou configured yourself, so TinyBase stays out of the Azureauthentication story.
Scope I have in mind for a first PR:
StoreandMergeableStore. Tabularneeds per-table change detection, which is the expensive part on SQL Server,
so I would leave it for later.
rowversioncolumn rather than using notifications.Service Broker is not available on Azure SQL Database and Change Tracking
needs
ALTER DATABASE, so neither seemed right to require.mssqlas an optional peer dependency, and a variant in the database matrix.One thing worth flagging before I open anything: T-SQL needs three small
dialect parameters threaded through the shared database code —
WHERE(true)is not valid,
nvarchar(max)cannot be a primary key, and dropping a columnis spelled
DROP COLUMN. They default to the current spelling so SQLite andPostgreSQL emit byte-identical SQL, but it does touch files every Persister
shares. Happy to shape that however you prefer.
I have it working and tested against SQL Server 2022 if that is of interest.
The branch is at
https://github.com/nltgpeterskoglund/tinybase/tree/mssql-persister — four
commits, following the dependency / boilerplate / tests / docs order. Happy to
open it as a PR, or to rework the scope first if you would rather it landed
differently.
All reactions