Commit graph

17 commits

Author SHA1 Message Date
64a4058cce Start to add compatibility with squee returning #f for null values
While maintaining compatibility for older versions of squee.
2021-01-02 10:06:27 +00:00
d2646e7110 Remove some non-existent imports 2020-10-04 13:22:24 +01:00
e2e55c69de Rework the shortlived PostgreSQL specific connection channel
In to a generic thing more like (ice-9 futures). Including copying some bits
from the (ice-9 threads) module and adapting them to work with this fibers
approach, rather than futures. The advantage being that using fibers channels
doesn't block the threads being used by fibers, whereas futures would.
2020-10-03 21:32:46 +01:00
9723a18df4 Add some utilities to work with PostgreSQL connections in threads 2020-10-03 09:20:39 +01:00
1bdc8855ba Extract out opening PostgreSQL connections
So this can be reused.
2020-10-03 08:55:56 +01:00
71afa93981 Make with-postgresql-connection work with multiple values 2020-10-02 20:15:23 +01:00
404f39a9ee Drop default thread count for make-postgresql-connection-channel
At least for data deletion, 4 seems unnecessary.
2020-10-01 19:41:13 +01:00
614f9888a5 Add some utilities to use PostgreSQL/Squee through a channel
To allow for some concurrency.
2020-10-01 19:13:30 +01:00
0cc78b90ae Support setting a statement timeout
To stop queries related to the web server that run for a long time.
2020-04-24 08:59:32 +01:00
8e9f1af89b Use the config options when creating the default paramstring 2020-04-07 17:37:03 +01:00
b337c5fcb2 Add a function to check if the test database is being used
This helps avoid problems when running the tests, and the test database not
being used.
2020-02-24 21:15:43 +00:00
356a5954b2 Add support for using a database URI
As this is useful when working with pg_tmp.
2019-10-08 19:45:41 +01:00
1441942200 Hack better NULL support on to (squee)
PQgetvalue used by squee returns null values as empty strings, which are
ambiguous for string fields. Therefore, use PQgetisnull to implement a
serialiser for squee which checks empty strings to see if they're actually a
NULL value, then returns '() in this case.

exec-query-with-null-handling can be used to access this behaviour.
2019-09-04 12:52:12 +02:00
fde1000cb3 Add a couple of functions for PostgreSQL advisory locks
Use symbol-hash to convert a symbol to the number for the lock. I'm hoping
this is OK, and it seems to be stable.
2019-07-12 19:51:42 +01:00
743cec7cb6 Associate a name with database connections
This helps when working out which connection to the database is doing what.
2019-07-12 19:49:26 +01:00
051962b54d Add a with-postgresql-transaction procedure
To help with running tests.
2019-05-05 13:35:17 +01:00
2e45bb0696 Extract out some database functionality to another module 2019-04-14 10:04:51 +01:00