mirror of
https://github.com/ent/ent.git
synced 2026-05-28 09:49:08 +03:00
integ: add sqlite to json tests (#686)
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
|
||||
"github.com/go-sql-driver/mysql"
|
||||
_ "github.com/lib/pq"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -83,6 +84,21 @@ func TestPostgres(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSQLite(t *testing.T) {
|
||||
client, err := ent.Open("sqlite3", "file:ent?mode=memory&cache=shared&_fk=1")
|
||||
require.NoError(t, err)
|
||||
defer client.Close()
|
||||
ctx := context.Background()
|
||||
require.NoError(t, client.Schema.Create(ctx, migrate.WithGlobalUniqueID(true)))
|
||||
|
||||
URL(t, client)
|
||||
Dirs(t, client)
|
||||
Ints(t, client)
|
||||
Floats(t, client)
|
||||
Strings(t, client)
|
||||
RawMessage(t, client)
|
||||
}
|
||||
|
||||
func Ints(t *testing.T, client *ent.Client) {
|
||||
ctx := context.Background()
|
||||
ints := []int{1, 2, 3}
|
||||
|
||||
Reference in New Issue
Block a user