Copying from the upcoming release notes:
{
// ...
"connections": [
{
// ...
"transform": "${type}[]"
}
]
}
${type}
will be replaced by the original type that was generated. In this case, we are transforming it into an array:
// before transformation
const rows = conn.query<{ id: number }>(conn.sql`SELECT id FROM users`)
// after transformation
const rows = conn.query<{ id: number }[]>(conn.sql`SELECT id FROM users`)
^^
transform accepts the following pattern: string | (string | [(from) string, (to) string])[]
.
For example:
"transform": "${type}[]"
(add []
to the end)"transform": ["${type}[]"]
(identical to the previous one)"transform": [["Nullable", "Maybe"]]
(replaces Nullable
with Maybe
)Owner Name | ts-safeql |
Repo Name | safeql |
Full Name | ts-safeql/safeql |
Language | TypeScript |
Created Date | 2022-09-08 |
Updated Date | 2023-03-16 |
Star Count | 795 |
Watcher Count | 5 |
Fork Count | 14 |
Issue Count | 7 |
Issue Title | Created Date | Updated Date |
---|