Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

schema-typegen

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

schema-typegen - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

2

help.txt

@@ -28,2 +28,4 @@ Usage: schema-typegen [opts] connection_string

Transform enum keys to pascal case. Default: false.
--bigint
Use bigint for int8 types instead of strings. Default: false.
-v/--version

@@ -30,0 +32,0 @@ Print the version number.

@@ -6,5 +6,6 @@ 'use strict'

const typeMapping = {
string: ['bpchar', 'char', 'varchar', 'text', 'uuid', 'bytea', 'inet', 'int8', 'time', 'timetz', 'interval', 'name'],
string: ['bpchar', 'char', 'varchar', 'text', 'uuid', 'bytea', 'inet', 'time', 'timetz', 'interval', 'name'],
number: ['int2', 'int4', 'float4', 'float8', 'numeric', 'money', 'oid'],
boolean: ['bool'],
bigint: [],
object: ['json', 'jsonb'],

@@ -51,3 +52,10 @@ Date: ['date', 'timestamp', 'timestamptz'],

async function getSchemaDefinition (opts) {
const { schema, connection } = opts
const { schema, connection, bigint } = opts
if (bigint) {
typeMapping.bigint.push('int8')
} else {
typeMapping.string.push('int8')
}
const sql = postgres(connection, getPostgresOpts(opts))

@@ -54,0 +62,0 @@ try {

5

package.json
{
"name": "schema-typegen",
"version": "2.3.0",
"version": "2.4.0",
"description": "Generate TypeScript type definitions from database schema",

@@ -10,3 +10,4 @@ "main": "schema-typegen.js",

"scripts": {
"test": "standard && tap test/*.js --100 --before=test/helpers/setup-postgres.js",
"test": "tap test/*.js --100 --before=test/helpers/setup-postgres.js",
"lint": "standard",
"lint:fix": "standard --fix"

@@ -13,0 +14,0 @@ },

@@ -59,2 +59,4 @@ <h1 align="center">Welcome to schema-typegen 👋</h1>

Transform enum keys to pascal case. Default: false.
--bigint
Use bigint for int8 types instead of strings. Default: false.
-v/--version

@@ -61,0 +63,0 @@ Print the version number.

@@ -20,2 +20,3 @@ #! /usr/bin/env node

pascalEnums: false,
bigint: false,
schema: 'public',

@@ -29,3 +30,3 @@ output: undefined,

const argv = minimist(argvs, {
boolean: ['type', 'noSemi', 'semicolons', 'version', 'optionals', 'ssl', 'pascal-enums'],
boolean: ['type', 'noSemi', 'bigint', 'semicolons', 'version', 'optionals', 'ssl', 'pascal-enums'],
alias: {

@@ -32,0 +33,0 @@ suffix: 'f',

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc