mirror of
https://github.com/xiaoqidun/entps
synced 2024-11-22 19:06:46 +08:00
docs(更新文档): 更新文档
This commit is contained in:
parent
f80c9c8f60
commit
24e9ab1571
25
README.md
25
README.md
@ -1,3 +1,28 @@
|
|||||||
# entps
|
# entps
|
||||||
|
|
||||||
ent pure go sqlite3 driver
|
ent pure go sqlite3 driver
|
||||||
|
|
||||||
|
# example
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"<project>/ent"
|
||||||
|
_ "github.com/xiaoqidun/entps"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
client, err := ent.Open("sqlite3", "file:ent?mode=memory&cache=shared&_fk=1")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed opening connection to sqlite: %v", err)
|
||||||
|
}
|
||||||
|
defer client.Close()
|
||||||
|
if err := client.Schema.Create(context.Background()); err != nil {
|
||||||
|
log.Fatalf("failed creating schema resources: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user