1const pg = require('pg');
2const connectionString = process.env.DATABASE_URL || 'postgres://localhost:5432/todo';
3
4const client = new pg.Client(connectionString);
5client.connect();
6const query = client.query(
7 'CREATE TABLE items(id SERIAL PRIMARY KEY, text VARCHAR(40) not null, complete BOOLEAN)');
8query.on('end', () => { client.end(); });1
9