interface Translation {
__: string
hr?: string
cs?: string
de?: string
en?: string
}
// table schema
export const nodes = mysqlTable('nodes', {
// ...
name: json('value').$type<Translation>().notNull(),
// ...
}
// inserting JSON
await db.insert(models.nodes)
.values({
//...
// node.name = {
// "__": "Moda",
// "hr": "Moda",
// "cs": "Móda",
// "en": "Fashion",
// "de": "Mode"
// }
name: node.name
//...
})
interface Translation {
__: string
hr?: string
cs?: string
de?: string
en?: string
}
// table schema
export const nodes = mysqlTable('nodes', {
// ...
name: json('value').$type<Translation>().notNull(),
// ...
}
// inserting JSON
await db.insert(models.nodes)
.values({
//...
// node.name = {
// "__": "Moda",
// "hr": "Moda",
// "cs": "Móda",
// "en": "Fashion",
// "de": "Mode"
// }
name: node.name
//...
})