Skip to content

Commit

Permalink
feat(typegen): go: format
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacharrisholt committed Mar 21, 2024
1 parent 936a6d7 commit eaba420
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/server/templates/go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ export const apply = ({
}: GeneratorMetadata): string => {
const columnsByTableId = columns
.sort(({ name: a }, { name: b }) => a.localeCompare(b))
.reduce((acc, curr) => {
acc[curr.table_id] ??= []
acc[curr.table_id].push(curr)
return acc
}, {} as Record<string, PostgresColumn[]>)
.reduce(
(acc, curr) => {
acc[curr.table_id] ??= []
acc[curr.table_id].push(curr)
return acc
},
{} as Record<string, PostgresColumn[]>
)

const compositeTypes = types.filter((type) => type.attributes.length > 0)

Expand Down

0 comments on commit eaba420

Please sign in to comment.