Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Using Atlas migration with pgvector plugin (Community Edition)

create container

local use

docker build -t custom-pgvector .

atlas hcl file config

dev="docker+postgres://_/custom-pgvector:latest/dev?search_path=public&sslmode=disable"

hub use (recommend)

# 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"

version migration

migrate diff

atlas migrate diff --env local

migrate lint

atlas migrate lint --env local

migrate apply

atlas migrate apply --env production

declare migration( for local use )

need enable postgres plugin manually

atlas schema apply --env local

Ent Integration

Example 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)",
            }),
    }
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages