UNPKG

hyperdb-helper

Version:

A wee little helper cli for working with hyperdb schemas

38 lines (29 loc) 784 B
import dedent from 'string-dedent' export const configFileTemplate = () => { return dedent` export const config = { schemaFilepath: './schema.js', functionsFilepath: './functions.js', generatedDirectory: './generated', } ` } export const schemaFileTemplate = (content = {}) => { return dedent` export function createSchema (hyperschema) { const schema = hyperschema.namespace('example') ${content.schema || ''} return hyperschema } export function createDatabase (hyperdb) { const database = hyperdb.namespace('example') ${content.database || ''} return database } ` } export const functionFileTemplate = (moduleType) => { return dedent` // Export map and trigger functions ` }