Commit graph

17 commits

Author SHA1 Message Date
b3f631e335 Use more reliable database locking strategy; reorganize tests
PostgreSQL and MySQL both have better locking mechanisms than what was previously implemented, as well
2017-07-07 21:06:38 -04:00
17ec6cf669 Move date formatting out of SQL and standardize on the DateFormatter trait
Fixes #56
2017-07-07 15:25:47 -04:00
7e7b204d85 Cleanup
- Revamped design of Query class to be more consistent and predictable, and generally suck less
- Removed special case for Query class in Statement class
- Cleaned up database schema somewhat
2017-07-07 11:49:54 -04:00
483874e21d Implemented query contexts
- Fixes #55
- Included test for Context
- Adjusted Database::editionLatest() to use Context
- Adjusted NCN handler and tests accordingly
- Also refined experimental Database::articleList() method and added experimental Database::articlePropertiesSet() method
2017-06-18 10:23:37 -04:00
c37d476ba0 Changes to Database internals
- Driver->prepare() can now take a new Database\Query object as the first parameter
- The Query class allows for building a complex query out of a main body, common table expressions, WHERE coniditions, ordering conditions, a limit, and offset
- The subscriptionList method is the prototypical example of usage
- The experimental articleList method will in time be adapted to use this as well
- A generic means of specifying a selection context is forthcoming; this would remove subscriptionList's $folder and $id parameters, for instance
2017-06-04 18:00:18 -04:00
8ebcb01cb5 Made out-of-order transaction handling more predictable 2017-05-07 18:27:16 -04:00
2083c6e397 Change transactions to auto-rollback on exceptions 2017-05-06 12:02:27 -04:00
f902346b6c Eliminated passing of RuntimeData instances
- RuntimeData has now been replaced by a single static Data class
- The Data class has a load() method which fills the same role as the constructor of RuntimeData
- The static Lang class is now an instantiable class and is a member of Data
- All tests have been adjusted and pass
- The Exception tests no longer require convoluted workarounds: a simple mock  for Data::$l suffices; Lang tests also use a mock to prevent loops now instead of using a workaround
2017-03-28 18:50:00 -04:00
7236020b8b Changed "NewsSync" to "Arsse" 2017-03-27 23:12:12 -05:00
b821d728e4 Add rest dependency; fix SQLite function def 2017-03-13 23:22:20 -04:00
6413d3a489 Re-order SQLite3 driver initialization
Should handle error reporting better
2017-03-13 19:13:06 -04:00
bb8af5a62c Added Custom Functions into Db/SQLite3/Driver
• Created Db/SQLite3/CustomFunctions to house the dateFormat custom
function and potentially others in the future.
• Fixed a typo in Db/SQLite3/Driver
2017-03-13 13:33:31 -05:00
18c8076a0f Database update tests 2017-03-09 21:39:42 -05:00
bdf3182305 Add result->lastId method; cleanup
- Result->lastId() added as MySQL and PostgreSQL have equivalent functionality
- Adjusted tests accordingly
- Cleaned up Database class to make use of this and getAll()
2017-03-09 14:48:42 -05:00
7c1df71acd Make db throw specific exceptions
Needs testing and fleshing out; not all exception codes and messages have been defined
2017-03-08 09:55:16 -05:00
fa247b34f6 Reduce the number of database exception types 2017-03-08 08:19:42 -05:00
7687109132 Reorganize Db namespace; alter User ns to match 2017-03-07 18:01:13 -05:00
Renamed from lib/Db/DriverSQLite3.php (Browse further)