0.3.6 • Published 2 years ago

@postgresql-typed/pg v0.3.6

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

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

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.2

2 years ago

0.2.3

2 years ago

0.3.1

2 years ago

0.2.2

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago