1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 17:12:41 +00:00
Commit graph

90 commits

Author SHA1 Message Date
J. King
0f2da754c5 Fix remaining test problems 2022-06-04 23:02:24 -04:00
J. King
e65069885b Clean up obsolete FIXMEs 2022-04-25 18:30:13 -04:00
J. King
2489743d0f Further simplifications 2022-04-23 13:21:52 -04:00
J. King
b5579d6e43 Support PHP 8.1 2022-01-11 17:54:02 -05:00
J. King
19ab9df063 Fix more bugs 2021-05-18 18:42:42 -04:00
J. King
ed27e0aaaa Sort nulls consistently
PostgreSQL normally sorts nulls after everything else in ascending order
and vice versa; we reverse this, to match SQLIte and MySQL
2021-02-02 10:00:08 -05:00
J. King
e60f7ea03f Add class constant visibility 2020-03-01 18:32:01 -05:00
J. King
bc53a2d24a Style fixes 2020-03-01 15:16:50 -05:00
J. King
bbace7a0ac Use void and nullable return types where practical 2020-01-20 13:34:03 -05:00
J. King
7ac4fb4715 Clarify PDO workaround for SQLite 2019-10-18 16:09:01 -04:00
J. King
29667464a1 Remove unnecessary namespace imports 2019-09-05 10:03:32 -04:00
J. King
f7240301e4 Basic database maintenance
Closes #169
2019-07-26 09:37:51 -04:00
J. King
6ef13d0880 Style fixes 2019-05-01 22:52:20 -04:00
J. King
ff0c9a3a55 Add functionality for interacting with subscription tags 2019-03-06 22:15:41 -05:00
J. King
ed22090e49 Work around various SQLite-related problems
- WAL mode was not getting set properly
- Queries using the PDO driver could fail because PDO sucks
2019-03-04 11:05:46 -05:00
J. King
21fdd66d37 Work around limit to SQL parameter placeholders for IN() clauses
Improves #150

LIKE-based matches also need to be similarly conservative
2019-03-01 22:36:25 -05:00
J. King
837f3c6dd6 Simplify SQL type handling
This is done in anticipation of dealing with SQL types in
places other than statements
2019-03-01 12:17:33 -05:00
J. King
8ea1df920a Unify SQL timeouts
- Exec and lock timeouts now apply to MySQL
- Lock timeout now applies to PostgreSQL
- SQLite now uses a generic lock timeout setting which applies to all
2019-01-23 16:31:54 -05:00
J. King
05aadfe7c7 Use correct SQLite chema change procedure; version bump 2019-01-21 10:40:39 -05:00
J. King
5cd84c4ab4 Validate configuration parameters on import, and other changes
- Each parameter is checked for type and normalized
- Interval strings are converted to DateInterval objects
- Timeouts can be specified as interval strings
- Most intervals can be null to signify infinity
- Driver classes are checked that they implement the correct interface
- Short driver names may be used, and are used by default
- Helpful errors messages are printed in case of erroneous configuration

Exporting is currently broken; this will be fixed in an upcoming commit
2019-01-20 22:40:49 -05:00
J. King
c4a41255b0 Experimental native MySQL driver
No testing has been performed yet, but changes are extensive enough to
warrant a commit. Of particular note:

- SQL states are enumerated in a separate trait to reduce duplication
- PDOStatement is now an abstract class to avoid duplication of
engine-specific error handling
- Error handling has been cleaned up somewhat
2019-01-10 19:01:32 -05:00
J. King
206cca35a9 Test tweaks 2018-12-21 17:51:49 -05:00
J. King
f0d30c2eee Make munging of queries a generic feature 2018-12-21 12:35:10 -05:00
J. King
4ef36643a4 Proof-of-concept PDO MySQL driver
- Configuration options were added
- Non-transactional locking was added to the savepoint handlers
- Tests were adjusted for MySQL's reserved words
2018-12-20 18:06:28 -05:00
J. King
161f5f08f6 Proactively support SQLite 3.25 2018-12-12 12:21:28 -05:00
J. King
0f48ce6f37 Use a Unicode collation for SQLite 2018-12-11 14:14:32 -05:00
J. King
0513b606c2 Merge master 2018-12-07 19:21:44 -05:00
J. King
089f666de6 Fix PDO insert ID errors in PHP 7.1 2018-12-06 17:46:00 -05:00
J. King
cf896121b2 Style fixes 2018-12-05 17:28:11 -05:00
J. King
8fc31cfc40 Rewrite various queries to work in PostgreSQL
This involved changes to the driver interface as well as the database
schemata. The most significantly altered queries were for article
selection and marking, which relied upon unusual features of SQLite.
Overall query efficiency should not be adversely affected (it may have
even imprved) in the common case, while very rare cases (not presently
triggered by any REST handlers) require more queries.

One notable benefit of these changes is that functions which query
articles can now have complete control over which columns are returned.
This has not, however, been implemented yet: symbolic column groups are
still used for now.

Note that PostgreSQL still fails many tests, but the test suite runs to
completion. Note also that one line of the Database class is not
covered; later changes will eventually make it easier to cover the line
in question.
2018-12-04 20:41:21 -05:00
J. King
736a8c9d0c Improved timeout handling for both SQlite and PostgreSQL 2018-11-22 13:30:13 -05:00
J. King
efac62f0e4 Add missing return type hints where possible 2018-11-06 12:50:26 -05:00
J. King
ba0aeab7ec Make SQL statement type conversion use ValueInfo normalizer
This sees the addition of a dateOutFormat parameter to ValueInfo::normalize(), as well as a general simplification of how parameter binding works.

Some value type-casting results are slightly different, but this simply makes SQL statement objects consistent with the rest of the system.
2017-12-30 18:50:56 -05:00
J. King
bc9fcb975f Change "rebind" to "retype" to better reflect what actually happens 2017-12-30 17:04:21 -05:00
J. King
bc9ffa0e17 Rewrite SQLite 3 type binding tests 2017-12-30 15:59:45 -05:00
J. King
39cad91b78 CS fixes 2017-12-22 11:51:58 -05:00
J. King
ad6a09ffa1 Partially tested pdo_sqlite driver; improves #72 2017-12-19 17:15:05 -05:00
J. King
ef75b5e9ab SQLite driver tweaks 2017-12-19 12:11:49 -05:00
J. King
7ca0f4e877 Make the SQLite3 driver more generic
The changes in this commit should make it more practical to:

- Allow the driver to decide for itself whether to try creating a PDO object if its own requirements are not met
- Have any driver use a generic schema update procedure
- Use the same constructor for native and PDO SQLite
2017-12-18 18:29:32 -05:00
J. King
0b3b3cb49c Use SQLite nocase collation; improves #127 2017-12-07 18:05:34 -05:00
J. King
821bb22a72 SQLite concurrency tweaks; fixes #131 2017-12-01 16:37:58 -05:00
J. King
5cd7268c0a Added incorrectDbCharset to NCNv1 server status
This has been exposed since version 11.0.3, released before our version 0.1.0, but after implementation work had begun
2017-11-29 18:14:59 -05:00
J. King
6da86428c4 Added per-file legal boilerplate
Includes PHPDoc license tag in the file-level block with accompanying copyright notice.

Also added an AUTHORS file on the off chance of outside contributions
2017-11-16 20:51:03 -05:00
J. King
11b2066922 Added per-file legal boilerplate
Includes PHPDoc license tag in the file-level block with accompanying copyright notice.

Also added an AUTHORS file on the off chance of outside contributions
2017-11-16 20:23:18 -05:00
J. King
42a5ccb96c Handle request splitting in data model rather than controllers
Queries for multiple specific articles are limited in size because of limits on  the number of bound query parameters.

Currently this limit is somewhat arbitrarily set at 50, but it may increase.

Historically controllers would be responsible for chunking input, but this will present problems when the expected output is a result set, and of course the maintenance burden increases as the number of controllers increases.

This commit transfers the burden to the data model, and consequently introduces a ResultAggregate class which collects chunked result sets (currently only for articleList).

In the course of making these changes the mock Result class was also largely rewritten, fixing many bugs with it.

This commit does not modify the controllers nor their tests; this will be done in a subsequent commit.
2017-11-06 23:32:29 -05:00
J. King
f51152980c Introduce abstract class for result sets
Most of the SQLite3 Result class' methods are fully generic, so it should be helpful for future result sets
2017-11-05 22:28:19 -05:00
J. King
9304f99032 Make result sets single-use; change savewepoint exceptions
- Result sets are now single-use; this is required for PDO drivers (PDO result sets are not rewindable)
- Change savepoint exceptions to be simple database exceptions; codes remain the same
2017-11-05 22:13:44 -05:00
J. King
cc875be57e Backport testing improvements from ttrss branch 2017-10-19 15:32:18 -04:00
J. King
96ebf936e4 CS fixes 2017-09-28 09:01:43 -04:00
J. King
e74a3ae3cb Fix numerous bugs when adding or changing folders
- Specifying a non-integer parent no longer silently casts to 0 or 1
- Specifying a folder ID of 0 now always converts to null automatically
- Performing both a rename and move to root in the same operation no longer results in potential duplicates
- Calling folderSetProperties with an empty data array no peforms an update; it now returns false before the update call
- Modification timestamps are now actually updated when a folder is modified
- Constraint violation exceptions triggered by code (rather than the database) now print a message
- Renaming a folder or subscription to a non-string value (e.g. an array) throws an exception rather than silently casting
- Added tests to better cover all the above
- Centralized the normalization of integers and title strings into a new ValueInfo static class
2017-09-26 16:45:41 -04:00