🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More →
Socket
Book a DemoSign in
Socket

@postgresql-typed/postgres

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@postgresql-typed/postgres

A type-safe PostgreSQL client for Node.js (Using the postgres module)

unpublished
latest
Source
npmnpm
Version
0.3.6
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@PostgreSQL-Typed/postgres

A type-safe PostgreSQL client for Node.js (Using the postgres module)

Table of Contents Installation
Usage
Ecosystem
License

Installation

Install @postgresql-typed/postgres and @postgresql-typed/cli (For generating types)

npm install --save @postgresql-typed/postgres
npm install --save-dev @postgresql-typed/cli

Usage

A documentation website is coming soon for the entire PostgreSQL-Typed ecosystem to explain how to use the system and all of its features.

# 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);

Ecosystem

PostgreSQL-Typed

This package is part of the PostgreSQL-Typed ecosystem.

License

Mozilla Public License 2.0

Keywords

postgresql

FAQs

Package last updated on 02 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts