File tree Expand file tree Collapse file tree
apps/desktop/src/entities/connection/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { camelCase , pascalCase } from 'change-case'
1+ import { camelCase } from 'change-case'
22import { safePascalCase } from './helpers'
33
44export function sqlSchemaTemplate ( table : string , columns : string ) {
@@ -8,14 +8,14 @@ ${columns}
88}
99
1010export function typeScriptSchemaTemplate ( table : string , columns : string ) {
11- const pascalName = pascalCase ( table )
11+ const pascalName = safePascalCase ( table )
1212 return `export interface ${ pascalName } {
1313${ columns }
1414}`
1515}
1616
1717export function zodSchemaTemplate ( table : string , columns : string ) {
18- const pascalName = pascalCase ( table )
18+ const pascalName = safePascalCase ( table )
1919 const camelName = pascalName . charAt ( 0 ) . toLowerCase ( ) + pascalName . slice ( 1 )
2020 return `import { z } from 'zod';
2121
@@ -45,7 +45,7 @@ ${columns}
4545}
4646
4747export function kyselySchemaTemplate ( table : string , body : string ) {
48- const pascalTable = pascalCase ( table )
48+ const pascalTable = safePascalCase ( table )
4949 const safeTableKey = / ^ [ a - z _ $ ] [ \w $ ] * $ / i. test ( table ) ? table : `'${ table } '`
5050 return `import { Generated } from 'kysely';
5151
You can’t perform that action at this time.
0 commit comments