From 2f6dd691829a06e24948dfb48d288512b998da9b Mon Sep 17 00:00:00 2001 From: Vladyslav Karpenko Date: Sun, 10 Dec 2023 16:52:25 +0200 Subject: [PATCH] Fix examples at Data access section of the LAYERS page --- content/en/LAYERS.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/en/LAYERS.md b/content/en/LAYERS.md index 29d77b9..901c6b5 100644 --- a/content/en/LAYERS.md +++ b/content/en/LAYERS.md @@ -296,21 +296,21 @@ This will send HTTP GET request to `http://worldtimeapi.org/api/timezone/Europe/ ## Data access -You can initialize database connection on application start from `application/db` for example putting `start` hook to `application/db/pg/start.js`: +You can initialize database connection on application start from `application/db` for example putting `start` hook to `application/db/geo/start.js`: ```js async () => { - db.geo.pg = new Pool(config.database); + db.geo = new npm.pg.Pool(config.database); }; ``` After that you can access db driver from anywhere like: ```js -const res = await db.geo.pg.query('SELECT * from CITIES where ID = $1', [25]); +const res = await db.geo.query('SELECT * from CITIES where ID = $1', [25]); console.log(res.rows[0]); ``` -More examples in: [/content/en/DATA.md](/content/en/DATA.md) +More details with examples in: [/content/en/DATA.md](/content/en/DATA.md) [👉 Back to contents](/) | [🚀 Getting started](/content/en/START.md) | [🗃️ Data modeling, storage, and access](/content/en/DATA.md) | [🧩 Application server features](/content/en/SERVER.md)