@wwwouter/typed-knex-generator
v0.0.4
Published
Generates Entity classes for typed-knex
Downloads
5
Maintainers
Readme
@wwwouter/typed-knex-generator
typedknexgeneratorfile.js
module.exports = {
knex: {
client: 'postgresql',
connection: {
database: 'db',
user: 'user',
password: 'pw'
},
},
generator: {
entityNameConversion: {
inflections: ['pascalCase', 'singular'],
overrides: [
{ tableName: "objects", override: "specialObjects" }
]
},
ignoreTables: [
'geography_columns', 'geometry_columns', 'raster_columns', 'raster_overviews.o_table_catalog', 'raster_overviews', 'spatial_ref_sys',
'knex_migrations_lock', 'knex_migrations',
'session'],
classFilePath: 'src/backend/controllers/<%= inflect(tableName, ["singular"]) %>',
}
};
npx @wwwouter/typed-knex-generator
Test
npm test
Update version
npm version major|minor|patch
npm publish --access public
git push