doc: minor fixes (#5878)
parent
05ea34b561
commit
b64ccb153a
14
doc/docs.md
14
doc/docs.md
|
@ -1766,21 +1766,21 @@ fn test() []int {
|
||||||
|
|
||||||
## ORM
|
## ORM
|
||||||
|
|
||||||
(this is still in an alpha state)
|
(This is still in an alpha state)
|
||||||
|
|
||||||
V has a built-in ORM (object-relational mapping) which supports SQLite, and will soon support MySQL, Postgres, MS SQL, and Oracle.
|
V has a built-in ORM (object-relational mapping) which supports SQLite, and will soon support MySQL, Postgres, MS SQL, and Oracle.
|
||||||
|
|
||||||
V's ORM provides a number of benefits:
|
V's ORM provides a number of benefits:
|
||||||
|
|
||||||
- One syntax for all SQL dialects. Migrating between databases becomes much easier.
|
- One syntax for all SQL dialects. (Migrating between databases becomes much easier.)
|
||||||
- Queries are constructed using V's syntax. There's no need to learn another syntax.
|
- Queries are constructed using V's syntax. (There's no need to learn another syntax.)
|
||||||
- Safety. All queries are automatically sanitised to prevent SQL injection.
|
- Safety. (All queries are automatically sanitised to prevent SQL injection.)
|
||||||
- Compile time checks. This prevents typos which can only be caught during runtime.
|
- Compile time checks. (This prevents typos which can only be caught during runtime.)
|
||||||
- Readability and simplicity. You don't need to manually parse the results of a query and then manually construct objects from the parsed results.
|
- Readability and simplicity. (You don't need to manually parse the results of a query and then manually construct objects from the parsed results.)
|
||||||
|
|
||||||
```v
|
```v
|
||||||
struct Customer { // struct name has to be the same as the table name (for now)
|
struct Customer { // struct name has to be the same as the table name (for now)
|
||||||
id int // an field named `id` of integer type must be the first field
|
id int // a field named `id` of integer type must be the first field
|
||||||
name string
|
name string
|
||||||
nr_orders int
|
nr_orders int
|
||||||
country string
|
country string
|
||||||
|
|
Loading…
Reference in New Issue