orm: add support for custom table names & custom field names (#9697)

This commit is contained in:
Louis Schmieder 2021-04-15 09:53:43 +02:00 committed by GitHub
parent f1bda88964
commit dcf4a6b008
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 80 additions and 35 deletions

View file

@ -1,6 +1,7 @@
import sqlite
import mysql
[table: 'modules']
struct Module {
id int [primary; sql: serial]
name string
@ -11,8 +12,8 @@ struct Module {
struct User {
id int [primary; sql: serial]
age int [unique: 'user']
name string [unique]
is_customer bool [unique: 'user']
name string [sql: 'username'; unique]
is_customer bool [sql: 'abc'; unique: 'user']
skipped_string string [skip]
}