const base = require ( "./postgres-base" ) ; export const { pg_type , expire_time , one_result , all_results , count_result , PROJECT_COLUMNS , PUBLIC_PROJECT_COLUMNS , } = base ; let theDB = undefined ; export function db ( opts = { } ) { if ( theDB === undefined ) { let PostgreSQL = base . PostgreSQL ; for ( const module of [ "server-queries" , "blobs" , "synctable" , "user-queries" , "ops" , ] ) { PostgreSQL = require ( `./postgres-${ module }` ) . extend_PostgreSQL ( PostgreSQL ) ; } theDB = new PostgreSQL ( opts ) ; } return theDB ; }