Effect CommunityEC
Effect Community2mo ago
3 replies
janglad

Getting Column Names with Built-in Helpers in Effect Typescript Library

There's built in helpers for doing stuff like sql.insert(MySchema) which applies the field transforms etc under the hood. Is there something similar built in for just getting column names? So I could do

const mySchema = Schema.Struct({id: Schema.UUID, myField: Schema.Number})
sql`select ${mySchema} from my_table`

which with snakecase transforms would generate
select id, my_field from my_table
Was this page helpful?