0.3.6 • Published 11 months ago

@postgresql-typed/postgres v0.3.6

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
11 months ago
npm install --save @postgresql-typed/postgres
npm install --save-dev @postgresql-typed/cli
# Generate types
npx pgt gen
import { Client, isReady } from "@postgresql-typed/postgres";

import { Databases, DatabasesData } from "./__generated__/index.js";

const client = await new Client<Databases>(
	DatabasesData,
	process.env.DATABASE_URI
).testConnection();

if (!isReady(client)) {
	throw new Error("Client not ready");
}

const table = client.table("<your table path>");

const result = await table.select.execute("*");
if (!result.success) {
	throw new Error("Failed to select");
}

console.log(result.data.rows);
0.3.0

11 months ago

0.3.6

11 months ago

0.3.5

11 months ago

0.3.2

11 months ago

0.2.3

12 months ago

0.3.1

11 months ago

0.2.2

12 months ago

0.3.4

11 months ago

0.3.3

11 months ago

0.2.1

12 months ago

0.2.0

12 months ago

0.1.0

12 months ago