29 Commits

Author SHA1 Message Date
e062c24746 🤖 Automatic code style fixes 2024-03-05 07:40:43 +00:00
48c6692f46 Throw an exception if contructor gets called on a disabled plugin 2024-01-25 15:40:55 +01:00
9ac2cb9b11 Merge pull request #86 from cosmocode/gh-tests
Update GitHub workflows
2024-01-25 15:34:21 +01:00
a7a40fb292 Automatic code style fixes 2024-01-25 13:06:49 +01:00
549d6b89b9 Try optimizing the database before closing the connection 2024-01-25 10:58:59 +01:00
f71fd1504a don't log errors when opts table does not exist
This is to be expected on new setups and not an error. Other errors
would be problematic though.

This should be the last commit related to #80
2023-08-17 09:42:23 +02:00
74c4ec2549 Set busy timeout and use WAL mode. #80
The busy timout should tell the Sqlite driver to wait to acquire locks
instead of aborting immeadiately.

The Write-Ahead Logging mode should make parallel accesses to the
database more efficient. https://www.sqlite.org/wal.html
2023-08-01 09:10:27 +02:00
e49844fb93 add exception logging for #80
This should help to pinpoint the problem
2023-07-22 19:25:00 +02:00
fe64ba38fa never set db version to 0. related to #80
There is no need to initially set the database version to 0, returning 0
is enough to run the appropriate migrations.

This will partially fix #80. The underlying problem is probably a
temporary database lock that causes an exception in getOpt(). This still
needs to be addressed.
2023-07-22 19:19:06 +02:00
c70cffc97c abort migration handling early
We especially do not need to run VACUUM on every initialization.
2023-07-20 21:28:59 +02:00
27eb38dad6 Allow passing parameters as multiple function args
This is what the old query methods allowed. Passing in an array is still
somewhat cleaner, but allowing separate arguments should make porting
older code a bit more convenient.
2023-06-21 08:40:34 +02:00
0290deae91 log slow queries to the debug log 2023-06-15 15:08:03 +02:00
33e488b3ff Added queryKeyValueList convenience method
This is a common use case in plugins
2023-06-13 09:39:31 +02:00
10cb854a86 renamed getDB to getPdo
This is clearer in what to expect as a return value
2023-06-13 07:44:07 +02:00
03f14a77fb ensure we always get PDOExceptions
PDO::prepare sometimes throws ValueErrors (and maybe other Throwables)
so we convert them to PDOExceptions
2023-06-12 11:04:15 +02:00
7ddaad1152 Fix import/export handling, always split multi-statements
Even though mutliple statements can be passed to $sth->execute(),
failures will only be checked in the very first statement. Failures
later on will lead to the rest of the statements to be silently ignored
rendering our rollback strategy moot.

We now always split multiline statements and run them separately
(affects import and migrations).

The export was adjusted to not include the transaction handling and
fix entry exports.
2023-06-12 10:42:14 +02:00
e22957e91a keep only getDb method instead of pdo for compatibility 2023-03-22 12:09:41 +01:00
1fe23cd565 minor comment fix 2023-03-21 15:48:37 +01:00
801b921e6f backwards compatibility fixes 2023-03-21 15:47:02 +01:00
aeccf717e9 Merge remote-tracking branch 'upstream/devel' into feature-event-query-execute 2023-03-20 09:14:33 +01:00
b8ae489156 extend the event data 2023-03-20 09:05:49 +01:00
c9d29deffd added tests for SQLiteDB class 2023-03-19 11:44:53 +01:00
a7a36cdb36 save and query record improvements 2023-03-19 11:35:56 +01:00
2832a62c34 Merge pull request #74 from gkrid/feature-event-query-execute
PLUGIN_SQLITE_QUERY_EXECUTE
2023-03-18 21:21:03 +01:00
aae177f938 fix serialization support 2023-03-18 21:15:43 +01:00
15d0194894 Fix migrations
Multiple statements are only executed with PDO::exec() not with a
prepared statement
2023-03-18 21:14:21 +01:00
b35b734ae9 introduces 'PLUGIN_SQLITE_QUERY_EXECUTE' event that is triggered when the SQL query is executed 2023-03-17 13:18:28 +01:00
3a56750b42 admin interface cleanup
Query saving has been moved to its own class
2023-03-15 22:03:56 +01:00
8da7d8059f first go at refactoring
The goal is to completely deprecate the helper plugin in favor of
instantiating SQLiteDB
2023-03-15 19:45:11 +01:00