You've already forked pgvecto.rs
mirror of
https://github.com/tensorchord/pgvecto.rs.git
synced 2025-07-30 19:23:05 +03:00
@ -1,6 +1,8 @@
|
||||
import os
|
||||
import psycopg
|
||||
|
||||
import numpy as np
|
||||
import psycopg
|
||||
|
||||
from pgvecto_rs.psycopg import register_vector
|
||||
|
||||
URL = "postgresql://{username}:{password}@{host}:{port}/{db_name}".format(
|
||||
|
@ -1,9 +1,10 @@
|
||||
import os
|
||||
|
||||
import numpy as np
|
||||
from sqlalchemy import create_engine, select, insert
|
||||
from sqlalchemy import Integer, String
|
||||
from sqlalchemy import Integer, String, create_engine, insert, select
|
||||
from sqlalchemy.orm import DeclarativeBase, Mapped, Session, mapped_column
|
||||
|
||||
from pgvecto_rs.sqlalchemy import Vector
|
||||
from sqlalchemy.orm import Session, DeclarativeBase, mapped_column, Mapped
|
||||
|
||||
URL = "postgresql+psycopg://{username}:{password}@{host}:{port}/{db_name}".format(
|
||||
port=os.getenv("DB_PORT", 5432),
|
||||
|
@ -1,8 +1,9 @@
|
||||
from numpy import ndarray
|
||||
from psycopg import Connection, ProgrammingError
|
||||
from psycopg.adapt import Loader, Dumper
|
||||
from psycopg.adapt import Dumper, Loader
|
||||
from psycopg.pq import Format
|
||||
from psycopg.types import TypeInfo
|
||||
from numpy import ndarray
|
||||
|
||||
from ..utils.serializer import from_db_str, to_db_str
|
||||
|
||||
__all__ = ["register_vector"]
|
||||
|
@ -1,4 +1,5 @@
|
||||
import sqlalchemy.types as types
|
||||
|
||||
from ..utils import serializer
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import numpy as np
|
||||
from functools import wraps
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
||||
def ignore_none(func):
|
||||
@wraps(func)
|
||||
|
@ -1,5 +1,7 @@
|
||||
from typing import Optional
|
||||
|
||||
import numpy as np
|
||||
|
||||
from . import decorators
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import os
|
||||
import toml
|
||||
|
||||
import numpy as np
|
||||
import toml
|
||||
|
||||
PORT = os.getenv("DB_PORT", 5432)
|
||||
HOST = os.getenv("DB_HOST", "localhost")
|
||||
|
@ -1,19 +1,20 @@
|
||||
import pytest
|
||||
import psycopg
|
||||
import numpy as np
|
||||
import psycopg
|
||||
import pytest
|
||||
from psycopg import Connection, sql
|
||||
|
||||
from pgvecto_rs.psycopg import register_vector
|
||||
from tests import (
|
||||
URL,
|
||||
TOML_SETTINGS,
|
||||
VECTORS,
|
||||
OP_SQRT_EUCLID_DIS,
|
||||
OP_NEG_DOT_PROD_DIS,
|
||||
OP_NEG_COS_DIS,
|
||||
EXPECTED_SQRT_EUCLID_DIS,
|
||||
EXPECTED_NEG_DOT_PROD_DIS,
|
||||
EXPECTED_NEG_COS_DIS,
|
||||
EXPECTED_NEG_DOT_PROD_DIS,
|
||||
EXPECTED_SQRT_EUCLID_DIS,
|
||||
LEN_AFT_DEL,
|
||||
OP_NEG_COS_DIS,
|
||||
OP_NEG_DOT_PROD_DIS,
|
||||
OP_SQRT_EUCLID_DIS,
|
||||
TOML_SETTINGS,
|
||||
URL,
|
||||
VECTORS,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1,23 +1,23 @@
|
||||
import pytest
|
||||
import numpy as np
|
||||
from tests import (
|
||||
URL,
|
||||
TOML_SETTINGS,
|
||||
VECTORS,
|
||||
INVALID_VECTORS,
|
||||
OP_NEG_DOT_PROD_DIS,
|
||||
EXPECTED_SQRT_EUCLID_DIS,
|
||||
OP_SQRT_EUCLID_DIS,
|
||||
EXPECTED_NEG_DOT_PROD_DIS,
|
||||
OP_NEG_COS_DIS,
|
||||
EXPECTED_NEG_COS_DIS,
|
||||
LEN_AFT_DEL,
|
||||
)
|
||||
from sqlalchemy import create_engine, select, text, insert, delete
|
||||
from sqlalchemy import Integer, Index
|
||||
from pgvecto_rs.sqlalchemy import Vector
|
||||
from sqlalchemy.orm import Session, DeclarativeBase, mapped_column, Mapped
|
||||
import pytest
|
||||
from sqlalchemy import Index, Integer, create_engine, delete, insert, select, text
|
||||
from sqlalchemy.exc import StatementError
|
||||
from sqlalchemy.orm import DeclarativeBase, Mapped, Session, mapped_column
|
||||
|
||||
from pgvecto_rs.sqlalchemy import Vector
|
||||
from tests import (
|
||||
EXPECTED_NEG_COS_DIS,
|
||||
EXPECTED_NEG_DOT_PROD_DIS,
|
||||
EXPECTED_SQRT_EUCLID_DIS,
|
||||
INVALID_VECTORS,
|
||||
LEN_AFT_DEL,
|
||||
OP_NEG_COS_DIS,
|
||||
OP_NEG_DOT_PROD_DIS,
|
||||
OP_SQRT_EUCLID_DIS,
|
||||
TOML_SETTINGS,
|
||||
URL,
|
||||
VECTORS,
|
||||
)
|
||||
|
||||
|
||||
class Base(DeclarativeBase):
|
||||
|
Reference in New Issue
Block a user