types-from-sql
Last updated 17 days ago by o175 .
MIT · Original npm · Tarball · package.json
$ cnpm install types-from-sql 
SYNC missed versions from official npm registry.

Works only with Postgres. It reads pg connection options from enviroment variables

Usage:

PGPASSWORD=1 PGUSER=1 PGDATABASE=1 PGHOST=1.1.1.1 PGPORT=5432 npx types-from-sql 'select * from table'

-f specify glob instead of query, -fn to set interface name to filename:

PGPASSWORD=1 PGUSER=1 PGDATABASE=1 PGHOST=1.1.1.1 PGPORT=5432 npx types-from-sql -f ./test/*.sql

also interface name can be set with directive @InterfaceName in comment on top of sql:

 -- @InterfaceName: INotification
select * from table

redirect output to interface file with > operator:

PGPASSWORD=1 PGUSER=1 PGDATABASE=1 PGHOST=1.1.1.1 PGPORT=5432 npx types-from-sql -fn ./test/*.sql

See also sql builder with typecheck: https://github.com/xialvjun/ts-sql-plugin#readme

Current Tags

  • 1.0.9                                ...           latest (17 days ago)

10 Versions

  • 1.0.9                                ...           17 days ago
  • 1.0.8                                ...           17 days ago
  • 1.0.7                                ...           17 days ago
  • 1.0.6                                ...           17 days ago
  • 1.0.5                                ...           20 days ago
  • 1.0.4                                ...           a month ago
  • 1.0.3                                ...           a month ago
  • 1.0.2                                ...           a month ago
  • 1.0.1                                ...           a month ago
  • 1.0.0                                ...           a month ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 63
Dependencies (13)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |