docker build -t custom-pgvector .atlas hcl file config
dev="docker+postgres://_/custom-pgvector:latest/dev?search_path=public&sslmode=disable"# push to hub
docker build -t xxx/atlas-dev-postgres:latest . &&atlas hcl file config
dev="docker+postgres://xxx/atlas-dev-postgres:latest/dev?search_path=public&sslmode=disable"migrate diff
atlas migrate diff --env localmigrate lint
atlas migrate lint --env localmigrate apply
atlas migrate apply --env productionneed enable postgres plugin manually
atlas schema apply --env localExample of using pgvector with Ent:
import (
"entgo.io/ent"
"entgo.io/ent/dialect"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/index"
"github.com/pgvector/pgvector-go"
)
// Fields of the Embedding.
func (Embedding) Fields() []ent.Field {
return []ent.Field{
field.Other("embedding", pgvector.Vector{}).
SchemaType(map[string]string{
dialect.Postgres: "vector(1536)",
}),
}
}