#postgresql #finql #adaptor #time #connection #handler

finql-postgres

Internal crate used by finql implementing the postgres adaptor

5 unstable releases

0.3.0 Jul 6, 2021
0.2.3 Mar 14, 2021
0.2.2 Mar 12, 2021
0.2.0 Feb 18, 2021
0.1.0 Feb 1, 2021

#32 in #adaptor

30 downloads per month

MIT/Apache

69KB
1.5K SLoC

Rust 1.5K SLoC // 0.0% comments SQL 164 SLoC // 0.5% comments

finql-postgres

finql-postgres is an implementation of the finql-data data handler trait used by the finql crate. The implementation an adaptor to the postgreSQL database. It is only useful in connection with finql.

The implementation is based on sqlx, which uses macros to enable query checking at compile time. In order to achieve this, a valid database must be specified, otherwise the build will fail.

Therefore, pleas follow the following steps to build the library:

  1. Setup a postgreSQL server, e.g. following the documentation on https://www.postgresql.org
  2. Setup a postgreSQL user named finqltester
  3. Upload the file data/finqlpg.sql to a database of your choice, e.g. by
psql <databasename> < data/finqlpg.sql

as some user with write to create new databases, PostgreSQL's default user postgres.

  1. export the database connection string on the command line with
export DATABASE_URL="postgresql://127.0.0.1/<databasename>?user=finqltester&password=<password>&ssl=false"

for a http connection or

export DATABASE_URL="postgresql:///<databasename>?user=finqltester&password=<password>&ssl=false"

for a connection via UNIX socket, depending on your setup.

  1. build the library with cargo build

Please note that this database is only used once for building the library and performing all the compile time checks. Once the build is complete, the database handler is able to set up a new empty database.

Dependencies

~20–31MB
~628K SLoC