Generating Typescript Types from Postgres

Photo by Uriel Soberanes on Unsplash
COMMENT ON TABLE member 
IS 'Member of the organization @cached @alias:person';
comment: 'Member of the organization',
tags: { cached: true, alias: 'person' }
const path = require('path');module.exports = {
connection: {
host: 'localhost',
user: 'postgres',
password: 'postgres',
database: 'acme',
},
schemas: [
{
name: 'public',
modelFolder: path.join(__dirname, 'src', 'models'),
},
],
};
$ npx kanel
/** @type {import('./models/Actor').default} */
const actor = fetchActor();

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store