1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-24 14:50:46 +01:00
eclair/eclair-core
Pierre-Marie Padiou 33d52b6535
More database nits (#1773)
* use prepared statements for pruning

* optional read-only user

It is good practice to create a dedicated read-only user to browse the
database safely. But since the app itself creates its tables, the
postgres user is the owner and a manual `GRANT` is required everytime a
new table is added.

This PR makes it possible to specify an arbitrary username, that will be
granted read-only access to all tables in the `public` schema.

NB: The assumption here is that eclair is the only app using the
eclair database (in the `CREATE DATABASE eclair` sense), which I believe
is reasonable.

* set timezone on lease table

This only affects newly created table, there is no migration.

Users that are already using postgres will keep the previous column
type, it doesn't change anything for them.

* put back lock timeout on lease table

We use a timeout, because due to concurrency we may not be able to
obtain a lock immediately.

The timeout has been set to its original value of 5s and made
configurable.

* obtain lock before initializing tables
2021-04-20 12:38:49 +02:00
..
src More database nits (#1773) 2021-04-20 12:38:49 +02:00
eclair-cli Refactor and simplify API dsl (#1690) 2021-03-09 15:23:50 +01:00
pom.xml Remove Docker test dependency (#1753) 2021-04-02 12:27:40 +02:00