
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
Define a types schema as
typesSchema = {
'string': [ 'bpchar', 'char', 'varchar', 'text', 'citext', 'uuid' ],
'number': ['int2', 'int4', 'int8', 'float4', 'float8', 'numeric' ],
'boolean': ['bool', 'boolean'],
'Date': ['date', 'timestamp', 'timestamptz'],
'Array<number>': ['_int2', '_int4', '_int8', '_float4', '_float8', '_numeric', '_money'],
'Array<boolean>': ['_bool', '_boolean'],
'Array<string>': ['_varchar', '_text', '_citext', '_uuid', '_bytea'],
'Object': ['json', 'jsonb'],
'Array<Object>': ['_json', '_jsonb'],
'Array<Date>': ['_timestamptz'],
'CustomTypes': [
{
name: 'point',
type: 'Coordinates',
definition: 'export interface Coordinates { x: number; y: number; }',
},
],
}
then just pass it as an argument with a database connection and output path.
postez(db, path, typesSchema)
.then(() => console.log("Done."))
.catch((e) => console.error(e));
You can also specify the name of table schema you want to generate types.ts.
postez(db, path, typesSchema, 'schema_name')
.then(() => console.log("Done."))
.catch((e) => console.error(e));
Otherwise you can use a default types schema (table schema name is 'public' by default if not specified) and pg-promise as simple as:
import pg from 'postez/lib/db'
import { postez } from "postez";
const configuration = {
user: 'username',
password: 'password',
host: 'host',
port: 'port',
database: 'database'
}
const db = pg.db(configuration)
const path = process.cwd().replace('./dist', './output');
postez(db, path)
.then(() => console.log("Done."))
.catch((e) => console.error(e));
on successfull run it will prompt out the following:
Succesfully generated files in: <path>/output/types.ts
Distributed under the MIT License. See LICENSE for more information.
FAQs
Utility tool for dynamically generate interfaces from PostgreSQL
We found that postez demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.