0.0.1 • Published 6 years ago
@central-factory/graphql2sql
Licence
—
Version
0.0.1
Deps
13
Size
59 kB
Vulns
0
Weekly
0
graphql2sql
GraphQL to SQL Schema Generator. Currently supports PostgreSQL.
Usage
See examples folder for a complete use case
import { readFile } from 'fs-extra';
import { join } from 'path';
import { load } from '../src/public_api';
(async () => {
const someSQLBefore = await readFile(join(__dirname, 'headers.sql'), 'utf8');
const content = await load(
join(__dirname, 'schema'),
null, // join(__dirname, 'out.sql')
{
databaseName: 'test',
tablePrefix: 't',
headers: someSQLBefore
}
);
})();