diff --git a/doc/docs.md b/doc/docs.md index 3c590333cb..f34a38cdcc 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -4009,8 +4009,9 @@ V's ORM provides a number of benefits: ```v import sqlite +// sets a custom table name. Default is struct name (case-sensitive) +[table: 'customers'] struct Customer { - // struct name has to be the same as the table name (for now) id int [primary; sql: serial] // a field named `id` of integer type must be the first field name string [nonull] nr_orders int @@ -4030,7 +4031,7 @@ sql db { create table Customer } -// select count(*) from Customer +// select count(*) from customers nr_customers := sql db { select count from Customer }