Frédéric Guillot
f084cfa7bd
Tweak Sqlite connection settings to reduce database locked errors
...
Related resources:
- https://litestream.io/tips/
- https://unixsheikh.com/articles/sqlite-the-only-database-you-will-ever-need-in-most-cases.html
2023-07-07 21:30:06 -07:00
Frédéric Guillot
25b93343ba
Avoid potential SQL injections without breaking compatibility with plugins
2023-07-03 15:40:34 -07:00
Joe Nahmias
a69709b305
quote sql query parameters when writing to the debug log
2023-02-20 19:23:53 -08:00
Frédéric Guillot
5e4d506b28
Enable Sqlite WAL mode by default
...
WAL provides more concurrency as readers do not block writers and,
a writer does not block readers. Reading and writing can proceed concurrently.
This change might reduce the number of errors related to locked databases.
For reference: https://sqlite.org/wal.html
2023-02-10 20:02:18 -08:00
Joe Nahmias
ee6cdb3565
picodb(mssql): support all MSSQL pdo drivers
...
For MSSQL make all connection attributes optional.
Handle differing DB connection params based on driver used.
connection can be made via ODBC DSN or server/hostname
username/password can be embedded in DSN definition or simply
omitted and single-signon will be attempted.
2022-10-23 16:19:50 -07:00
Joe Nahmias
bb7f8b4621
picodb(mssql): recognize 2627 and 23000 as dup key errors
2022-10-23 16:19:50 -07:00
Joe Nahmias
104f492301
picodb(mssql): fix retrieval of DB version on MSSQL
2022-10-23 16:19:50 -07:00
Joe Nahmias
66d55e5be0
picodb(mssql): fix implementation of getLastId() on MSSQL
2022-10-23 16:19:50 -07:00
Joe Nahmias
37bc859df5
picodb(mssql): teach picodb to use TOP for limits on MSSQL
2022-10-23 16:19:50 -07:00
Joe Nahmias
5493c2997e
picodb(mssql): fix disable/enable foreign keys by removing GO
2022-10-23 16:19:50 -07:00
Joe Nahmias
0047efe803
picodb(mssql): fix conditional creation of schema table
2022-10-23 16:19:50 -07:00
Joe Nahmias
55c80aa090
picodb(mssql): escape closing brackets within identifiers
...
Ref: https://docs.microsoft.com/en-us/sql/t-sql/functions/quotename-transact-sql
2022-10-23 16:19:50 -07:00
Joe Nahmias
427abb9961
picodb: include error code in SQLException error message
2022-10-23 16:19:50 -07:00
Joe Nahmias
64f589f759
picodb: Table::buildSelectQuery() should default columns to current table
2022-10-23 16:19:50 -07:00
Joe Nahmias
e3b9b2ce8f
picodb: when logging SQL, include params as well
2022-10-23 16:19:50 -07:00
Joe Nahmias
bff5c15544
fix(picodb): do not include useless OFFSET 0 clauses
...
throws an error on MSSQL
2022-10-23 16:19:50 -07:00
Frédéric Guillot
fdbbb29cd6
Sqlite migrations should have foreign keys disabled outside the transaction
...
Existing behavior could lead to data loss if schema is changed.
2020-12-28 11:56:11 -08:00
kufeiko
cfada3542e
Use SET NAMES instead of charset for DB connection
...
When using charset in buildDsn, not all variables are set on the server side. That leads to MySQL assuming latin1 charset and errors with Cyrillic, for example (I figured out the letter 'И', capital breaks the things).
2018-07-04 10:22:13 -07:00
Frédéric Guillot
a491348d44
Vendoring deprecated composer libs
2018-06-21 14:13:41 -07:00