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.1.0 to 2.2.0

entities.ts

7

lib/typescript.js

@@ -101,4 +101,7 @@ 'use strict'

}
result += generateEnumTypes(opts, enums)
result += '\n'
const enumTypes = generateEnumTypes(opts, enums)
if (enumTypes) {
result += enumTypes
result += '\n'
}
result += generateTableTypes(opts, tables, typeMapping, enums)

@@ -105,0 +108,0 @@ return result

{
"name": "schema-typegen",
"version": "2.1.0",
"version": "2.2.0",
"description": "Generate TypeScript type definitions from database schema",

@@ -5,0 +5,0 @@ "main": "schema-typegen.js",

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

id: number;
name?: string;
state?: UserState;
name: string | null;
state: UserState | null;
is_enabled: boolean;

@@ -105,3 +105,3 @@ }

```
schema-typegen -o ./entities.ts postgres://$(jq -r '.DB.USERNAME' config.json):$(jq -r '.DB.PASSWORD' config.json)@$(jq -r '.DB.HOST' config.json)$(jq -r '.DB.PORT' config.json)/$(jq -r '.DB.NAME' config.json)
schema-typegen -o ./entities.ts postgres://$(jq -r '.DB.USERNAME' config.json):$(jq -r '.DB.PASSWORD' config.json)@$(jq -r '.DB.HOST' config.json):$(jq -r '.DB.PORT' config.json)/$(jq -r '.DB.NAME' config.json)
```

@@ -108,0 +108,0 @@

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

fs.writeFileSync(opts.output, types)
console.log(`Generated types from ${schema.tables.length} tables and ${schema.enums.length} enums`)
console.log(`✔ Generated types from ${schema.tables.length} tables and ${schema.enums.length} enums`)
} else {

@@ -71,0 +71,0 @@ console.log(types)

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