UNPKG

@t1mmen/srtd

Version:

Supabase Repeatable Template Definitions (srtd): ๐Ÿช„ Live-reloading SQL templates for Supabase DX. Make your database changes reviewable and migrations maintainable! ๐Ÿš€

28 lines (27 loc) โ€ข 1.01 kB
interface TestContext { timestamp: number; testDir: string; testFunctionName: string; templateCounter: number; } /** * Creates a test context with all the goodies we need! ๐ŸŽ */ export declare function createTestContext(name?: string): TestContext; /** * Get unique template names - perfect for testing! ๐Ÿท๏ธ */ export declare function getNextTemplateName(context: TestContext, prefix?: string): string; /** * Create a template file with whatever content you want! ๐Ÿ“ */ export declare function createTemplate(context: TestContext, name: string, content: string, dir?: string): Promise<string>; /** * Create a template with a basic Postgres function - the bread and butter of testing! ๐Ÿž */ export declare function createTemplateWithFunc(context: TestContext, prefix: string, funcSuffix?: string, dir?: string): Promise<string>; /** * Clean up after our tests like good citizens! ๐Ÿงน */ export declare function cleanupTestContext(context: TestContext): Promise<void>; export {};