package ez_pgocaml
A simple library to work with pgocaml
Install
Dune Dependency
github.com
Readme
LGPL-2.1-only WITH OCaml-LGPL-linking-exception License
Edit opam file
Versions (1)
Authors
Maintainers
Sources
v1.0.tar.gz
sha256=57b409aeef2e0e5e372ba23d4ca40a5e62f5d85d3a69aeab301d0670da4a986c
Description
Published: 30 Mar 2021
README
README.md
ez_pgocaml : a simple library to work with pgocaml
Installation
To build:
opam pin .
opam install ez_pgocaml
Usage
A typical usage is to create a database migration tool for your application:
The file updater.ml
contains:
let () =
EzPGUpdater.main Versions.database Versions.versions
where versions.ml
contains:
let database = "testdb"
let update_0_to_1 dbh =
EzPG.exec dbh
(Printf.sprintf "CREATE TABLE %s (%s)"
"users"
{|
user_id bigserial PRIMARY KEY,
login VARCHAR NOT NULL,
pwhash bytea NOT NULL
|})
let update_1_to_2 dbh =
EzPG.exec dbh
(Printf.sprintf "CREATE TABLE %s (%s)"
"infos"
{|
user_id bigserial PRIMARY KEY,
city VARCHAR
|})
let versions = [
0, update_0_to_1;
1, update_1_to_2;
]
When ran, the corresponding executable will try to migrate the database from any version to the latest (2 in this example).
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page