Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function generateDatabase(
model: string,
config: { [id: string]: any },
) {
const backend: GraphQLBackendCreator = new GraphQLBackendCreator(
model,
config,
);
const connectionConfig = {
filename: `${folders.database}/db.sqlite`,
};
const manager = new DatabaseSchemaManager("sqlite3", connectionConfig);
backend.registerDataResourcesManager(manager);
await backend.createDatabase();
}
private async generateDatabase(): Promise {
const manager = new DatabaseSchemaManager("sqlite3", {
filename: ":memory:"
});
this.backendCreator.registerDataResourcesManager(manager);
await this.backendCreator.createDatabase();
return manager.getConnection();
}
}