1
0
mirror of https://github.com/xiaoqidun/entps synced 2024-10-03 21:00:22 +08:00
Go to file
2024-09-15 22:19:41 +08:00
.gitignore feat(初始项目): 初始项目 2021-08-11 11:43:19 +08:00
entps.go feat(初始项目): 初始项目 2021-08-11 11:43:19 +08:00
go.mod feat(升级依赖): 升级依赖 2024-09-15 22:19:41 +08:00
go.sum feat(升级依赖): 升级依赖 2024-09-15 22:19:41 +08:00
LICENSE Initial commit 2021-08-11 09:40:32 +08:00
README.md docs(更新文档): 更新文档 2021-08-11 15:33:33 +08:00

entps

ent pure go sqlite3 driver

example

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)
	}
}