1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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
5 changed files with 80 additions and 35 deletions

View File

@ -2,14 +2,18 @@
## Attributes
### Structs
- `[tablename: 'name']` sets a custom table name
### Fields
- `[primary]` sets the field as the primary key
- `[unique]` sets the field as unique
- `[unique: 'foo']` adds the field to a unique group
- `[nonull]` field will be `NOT NULL` in table creation
- `[skip]` field will be skipped
- `[sql: type]` sets the type which is used in sql (special type `serial`)
- `[sql: 'name']` sets a custom column name for the field
## Usage