0.5.2 • Published 4 days ago

@quillsql/node v0.5.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 days ago

Quill Node SDK

Installation

$ npm install @quillsql/node

# Or, if you prefer yarn
$ yarn add @quillsql/node

Usage

Instantiate quill with your credentials and add the below POST endpoint.

Note that we assume you have an organization id on the user returned by your auth middleware. Queries will not work properly without the organization id.

const quill = require("@quillsql/node")({
  privateKey: process.env.QULL_PRIVATE_KEY,
  databaseConnectionString: process.env.POSTGRES_READ,
});

// "authenticateJWT" is your own pre-existing auth middleware
app.post("/quill", authenticateJWT, async (req, res) => {
  // assuming user fetched via auth middleware has an organizationId
  const { organizationId } = req.user;
  const { metadata } = req.body;
  const result = await quill.query({
    orgId: organizationId,
    metadata,
  });
  res.send(result);
});

For local testing (dev purposes only)

Create an .env file with the following key-value pairs:

QUILL_PRIVATE_KEY=
DB_URL=
ENV=development
BACKEND_URL=

Use the following commands to start a locally hosted dev server.

npm install
npm run dev-server

You should be able to ping your local server at http://localhost:3000.

0.5.2

4 days ago

0.5.1

8 days ago

0.5.0

24 days ago

0.4.9

1 month ago

0.4.8

1 month ago

0.4.5

1 month ago

0.4.4

1 month ago

0.4.7

1 month ago

0.4.6

1 month ago

0.4.3

2 months ago

0.4.1

2 months ago

0.4.2

2 months ago

0.4.0

2 months ago

0.3.8

2 months ago

0.3.7

3 months ago

0.3.6

3 months ago

0.3.5

4 months ago

0.3.4

4 months ago

0.3.3

4 months ago

0.3.0

4 months ago

0.2.9

4 months ago

0.2.8

4 months ago

0.3.2

4 months ago

0.3.1

4 months ago

0.2.7

8 months ago

0.2.6

8 months ago

0.2.5

8 months ago

0.2.4

9 months ago

0.2.3

9 months ago

0.2.2

10 months ago

0.2.1

10 months ago

0.2.0

10 months ago

0.1.9

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.6

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago