Databases¶
| Engine | --driver |
Status |
|---|---|---|
| Microsoft SQL Server | sqlserver |
available |
| PostgreSQL | postgres |
available |
| SQLite | sqlite |
available |
| Oracle Database | in development | |
| MySQL / MariaDB | in development |
Sql2DevOps talks to each engine with its native protocol through drivers built into the executable: nothing else needs to be installed. Managed cloud versions work like your own servers: Azure SQL Database and Managed Instance, Amazon RDS and Aurora, Google Cloud SQL and AlloyDB, Azure Database for PostgreSQL, Supabase, Neon and others.
SQL Server¶
sqlserver://user:password@host:1433?database=app
sqlserver://user:password@host:1433?database=app&encrypt=true&TrustServerCertificate=false
- Scripts are split on
GOlines, as in SSMS and sqlcmd;GO 5repeats the batch five times. - A batch can hold many statements; the failure report shows the line where the failing statement starts, as SQL Server reports it.
- Lock:
sp_getapplock.
PostgreSQL¶
postgres://user:password@host:5432/app?sslmode=require
- Scripts are split on top-level
;, respecting strings, quoted identifiers,$$and$tag$bodies, nested comments andBEGIN ATOMIC ... ENDblocks. - Each batch is one statement; errors come with SQLSTATE, detail, hint and the exact line and column.
- psql variables (
:'name') work;\set ON_ERROR_STOP onis ignored. - Lock: an advisory lock.
SQLite¶
The connection string is the database file path.
- Scripts are split on top-level
;, respecting trigger bodies (CREATE TRIGGER ... BEGIN ...; END;). - SQLite has no session lock: concurrent writers wait on the file lock.
-
Functions that an application registers in code (often called by its triggers) get a fixed value per target, so statements touching those tables work:
targets: app-db: driver: sqlite dsn_env: APP_DB_PATH functions: { app_user: sql2devops, app_syncing: 0 }or
--sqlite-function name=valueonexecandpackage run.
File encodings¶
UTF-8, UTF-8 with BOM, UTF-16 and Windows-1252 are detected automatically, so scripts saved by older editors on Windows work as they are.