From 15242d8082a37478a933e22344b9d6a45319f8c1 Mon Sep 17 00:00:00 2001 From: Taras Date: Mon, 8 Nov 2021 12:22:42 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20add=20description=20of=20how=20to=20use?= =?UTF-8?q?=20a=20custom=20table=20name=20to=20the=20ORM=20example=20?= =?UTF-8?q?=E2=80=93=20(#12408)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/docs.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 }