// Code generated by modernc.org/undup from the per-target vec_*.go files; DO NOT EDIT.

//go:build (netbsd && amd64) || (openbsd && amd64) || (openbsd && arm64)

package vec

import (
	"unsafe"

	"modernc.org/libc"
	libsqlite3 "modernc.org/sqlite/lib"
)

type Tblkcnt_t = int64

type Tblksize_t = int32

type Tcaddr_t = uintptr

type Tclockid_t = int32

type Tcpuid_t = uint64

type Tdaddr_t = int64

type Tfixpt_t = uint32

type Tfsblkcnt_t = uint64

type Tfsfilcnt_t = uint64

type Tgid_t = uint32

type Tino_t = uint64

type Tkey_t = int64

type Tmode_t = uint32

type Tnlink_t = uint32

type Tqdiv_t = struct {
	Fquot Tquad_t
	Frem  Tquad_t
}

type Tquad_t = int64

type Tsegsz_t = int32

type Ttimer_t = int32

type Tu_char = uint8

type Tu_int = uint32

type Tu_long = uint64

type Tu_quad_t = uint64

type Tu_short = uint16

type Tuint = uint32

type Tulong = uint64

type Tunchar = uint8

type Tuseconds_t = uint32

type Tushort = uint16

func Xsqlite3_vec_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) (r int32) {
	bp := tls.Alloc(32)
	defer tls.Free(32)
	var i, i1 uint64
	var rc int32
	_, _, _ = i, i1, rc
	rc = m_SQLITE_OK
	rc = libsqlite3.Xsqlite3_create_function_v2(tls, db, __ccgo_ts+16107, 0, libc.Int32FromInt32(m_SQLITE_UTF8)|libc.Int32FromInt32(m_SQLITE_INNOCUOUS)|libc.Int32FromInt32(m_SQLITE_DETERMINISTIC), __ccgo_ts+6911, __ccgo_fp(__static_text_func), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0))
	if rc != m_SQLITE_OK {
		return rc
	}
	rc = libsqlite3.Xsqlite3_create_function_v2(tls, db, __ccgo_ts+16119, 0, libc.Int32FromInt32(m_SQLITE_UTF8)|libc.Int32FromInt32(m_SQLITE_INNOCUOUS)|libc.Int32FromInt32(m_SQLITE_DETERMINISTIC), __ccgo_ts+16129, __ccgo_fp(__static_text_func), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0))
	if rc != m_SQLITE_OK {
		return rc
	}
	i = uint64(0)
	for {
		if !(i < libc.Uint64FromInt64(384)/libc.Uint64FromInt64(24) && rc == m_SQLITE_OK) {
			break
		}
		rc = libsqlite3.Xsqlite3_create_function_v2(tls, db, _aFunc[i].FzFName, _aFunc[i].FnArg, _aFunc[i].Fflags, libc.UintptrFromInt32(0), _aFunc[i].FxFunc, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0))
		if rc != m_SQLITE_OK {
			**(**uintptr)(__ccgo_up(pzErrMsg)) = libsqlite3.Xsqlite3_mprintf(tls, __ccgo_ts+16398, libc.VaList(bp+8, _aFunc[i].FzFName, libsqlite3.Xsqlite3_errmsg(tls, db)))
			return rc
		}
		goto _1
	_1:
		;
		i = i + 1
	}
	i1 = uint64(0)
	for {
		if !(i1 < libc.Uint64FromInt64(64)/libc.Uint64FromInt64(32) && rc == m_SQLITE_OK) {
			break
		}
		rc = libsqlite3.Xsqlite3_create_module_v2(tls, db, _aMod[i1].Fname, _aMod[i1].Fmodule, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0))
		if rc != m_SQLITE_OK {
			**(**uintptr)(__ccgo_up(pzErrMsg)) = libsqlite3.Xsqlite3_mprintf(tls, __ccgo_ts+16429, libc.VaList(bp+8, _aMod[i1].Fname, libsqlite3.Xsqlite3_errmsg(tls, db)))
			return rc
		}
		goto _2
	_2:
		;
		i1 = i1 + 1
	}
	return m_SQLITE_OK
}

func Xsqlite3_vec_numpy_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) (r int32) {
	var rc int32
	_ = rc
	_ = pzErrMsg
	rc = m_SQLITE_OK
	rc = libsqlite3.Xsqlite3_create_function_v2(tls, db, __ccgo_ts+16458, int32(1), int32(m_SQLITE_RESULT_SUBTYPE), libc.UintptrFromInt32(0), __ccgo_fp(_vec_npy_file), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0))
	if rc != m_SQLITE_OK {
		return rc
	}
	rc = libsqlite3.Xsqlite3_create_module_v2(tls, db, __ccgo_ts+16471, uintptr(unsafe.Pointer(&_vec_npy_eachModule)), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0))
	return rc
}

func Xsqlite3_vec_static_blobs_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) (r int32) {
	var rc int32
	var static_blob_data uintptr
	_, _ = rc, static_blob_data
	_ = pzErrMsg
	rc = m_SQLITE_OK
	static_blob_data = libsqlite3.Xsqlite3_malloc(tls, int32(640))
	if !(static_blob_data != 0) {
		return int32(m_SQLITE_NOMEM)
	}
	libc.Xmemset(tls, static_blob_data, 0, uint64(640))
	rc = libsqlite3.Xsqlite3_create_function_v2(tls, db, __ccgo_ts+16484, int32(4), libc.Int32FromInt32(m_SQLITE_UTF8)|libc.Int32FromInt32(m_SQLITE_INNOCUOUS)|libc.Int32FromInt32(m_SQLITE_DETERMINISTIC)|libc.Int32FromInt32(m_SQLITE_SUBTYPE)|libc.Int32FromInt32(m_SQLITE_RESULT_SUBTYPE), libc.UintptrFromInt32(0), __ccgo_fp(_vec_static_blob_from_raw), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0))
	if rc != m_SQLITE_OK {
		return rc
	}
	rc = libsqlite3.Xsqlite3_create_module_v2(tls, db, __ccgo_ts+16509, uintptr(unsafe.Pointer(&_vec_static_blobsModule)), static_blob_data, __ccgo_fp(libsqlite3.Xsqlite3_free))
	if rc != m_SQLITE_OK {
		return rc
	}
	rc = libsqlite3.Xsqlite3_create_module_v2(tls, db, __ccgo_ts+16526, uintptr(unsafe.Pointer(&_vec_static_blob_entriesModule)), static_blob_data, libc.UintptrFromInt32(0))
	if rc != m_SQLITE_OK {
		return rc
	}
	return rc
}

var __ccgo_ts1 = "float32\x00int8\x00bit\x00\x00INTEGER\x00BLOB\x00TEXT\x00FLOAT\x00NULL\x00zero-length vectors are not supported.\x00invalid float32 vector BLOB length. Must be divisible by %d, found %d\x00out of memory\x00JSON array parsing error: Input does not start with '['\x00JSON parsing error\x00Input must have type BLOB (compact format) or TEXT (JSON), found %s\x00Unknown type for bitvector.\x00JSON parsing error: value out of range for int8\x00Unknown type for int8 vector.\x00Unknown subtype: %d\x00Error reading 1st vector: %s\x00Error reading 2nd vector: %s\x00Vector type mistmatch. First vector has type %s, while the second has type %s.\x00Vector dimension mistmatch. First vector has %ld dimensions, while the second has %ld dimensions.\x00vec0-npy-file\x00Cannot calculate cosine distance between two bitvectors.\x00Cannot calculate L2 distance between two bitvectors.\x00Cannot calculate L1 distance between two bitvectors.\x00Cannot calculate hamming distance between two float32 vectors.\x00Cannot calculate hamming distance between two int8 vectors.\x00Zero length vectors are not supported.\x00Binary quantization requires vectors with a length divisible by 8\x00Can only binary quantize float or int8 vectors\x00unit\x002nd argument to vec_quantize_int8() must be 'unit'.\x00Cannot add two bitvectors together.\x00Cannot subtract two bitvectors together.\x00slice 'start' index must be a postive number.\x00slice 'end' index must be a postive number.\x00slice 'start' index is greater than the number of dimensions\x00slice 'end' index is greater than the number of dimensions\x00slice 'start' index is greater than 'end' index\x00slice 'start' index is equal to the 'end' index, vectors must have non-zero length\x00start index must be divisible by 8.\x00end index must be divisible by 8.\x00[\x00,\x00null\x00%f\x00%d\x00]\x00only float32 vectors are supported when normalizing\x00text\x00int\x00integer\x00partition\x00key\x00float\x00double\x00blob\x00boolean\x00bool\x00int64\x00integer64\x00float64\x00f64\x00primary\x00f32\x00i8\x00distance_metric\x00l2\x00l1\x00cosine\x00%.*s\x00CREATE TABLE x(value, vector hidden)\x00False\x00Error parsing numpy array: numpy header did not start with '{'\x00Error parsing numpy array: expected key in numpy header\x00Error parsing numpy array: expected a string as key in numpy header\x00Error parsing numpy array: expected a ':' after key in numpy header\x00'descr'\x00Error parsing numpy array: expected a string value after 'descr' key\x00'<f4'\x00Error parsing numpy array: Only '<f4' values are supported in sqlite-vec numpy functions\x00'fortran_order'\x00Error parsing numpy array: Only fortran_order = False is supported in sqlite-vec numpy functions\x00'shape'\x00Error parsing numpy array: Expected left parenthesis '(' after shape key\x00Error parsing numpy array: Expected an initial number in shape value\x00Error parsing numpy array: Expected comma after first shape value\x00Error parsing numpy array: unexpected header EOF while parsing shape\x00Error parsing numpy array: expected right parenthesis after shape value\x00Error parsing numpy array: unknown type in shape value\x00Error parsing numpy array: unknown key in numpy header\x00Error parsing numpy array: unknown extra token after value\x00numpy array file too short\x00numpy array file does not contain the 'magic' header\x00numpy array file header length is invalid\x00numpy array file error: Expected a data size of %d, found %d\x00numpy array too short\x00numpy array does not contain the 'magic' header\x00numpy array header length is invalid\x00numpy array error: Expected a data size of %d, found %d\x00CREATE TABLE x(vector, input hidden)\x00input argument is required\x00r\x00Could not open numpy file\x00vec_npy_each only supports float32 vectors\x00SELECT id, chunk_id, chunk_offset FROM \"%w\".\"%w_rowids\" WHERE rowid = ?\x00Internal sqlite-vec error: could not initialize 'rowids get chunk position' statement\x00SELECT rowid FROM \"%w\".\"%w_rowids\" WHERE id = ?\x00Could not find a row with rowid %lld\x00vectors\x00Could not fetch vector data for %lld, opening blob failed\x00Could not fetch vector data for %lld, reading from blob failed\x00Internal sqlite-vec error: unknown error, could not close vector blob, please file an issue\x00SELECT partition%02d FROM \"%w\".\"%w_chunks\" WHERE chunk_id = ?\x00SELECT value%02d FROM \"%w\".\"%w_auxiliary\" WHERE rowid = ?\x00data\x00SELECT data FROM \"%w\".\"%w_metadatatext%02d\" WHERE rowid = ?\x00SELECT max(rowid) FROM \"%w\".\"%w_chunks\" WHERE \x00 AND \x00 partition%02d = ? \x00SELECT max(rowid) FROM \"%w\".\"%w_chunks\"\x00Internal sqlite-vec error: could not initialize 'latest chunk' statement\x00Internal sqlite-vec error: Could not find latest chunk\x00Internal sqlite-vec error: unknown result code when closing out stmtLatestChunk. Please file an issue: https://github.com/asg017/sqlite-vec/issues/new\x00INSERT INTO \"%w\".\"%w_rowids\"(rowid)VALUES (?);\x00Internal sqlite-vec error: could not initialize 'insert rowids' statement\x00UNIQUE constraint failed on %s primary key\x00Error inserting rowid into rowids shadow table: %s\x00INSERT INTO \"%w\".\"%w_rowids\"(id)VALUES (?);\x00Internal sqlite-vec error: could not initialize 'insert rowids id' statement\x00Error inserting id into rowids shadow table: %s\x00 UPDATE \"%w\".\"%w_rowids\" SET chunk_id = ?, chunk_offset = ? WHERE rowid = ?\x00Internal sqlite-vec error: could not initialize 'update rowids position' statement\x00Internal sqlite-vec error: could not update rowids position for rowid=%lld, chunk_rowid=%lld, chunk_offset=%lld\x00INSERT INTO \"%w\".\"%w_chunks\"\x00(size, validity, rowids\x00, partition%02d\x00) VALUES (?, ?, ?\x00, ?\x00)\x00INSERT INTO \"%w\".\"%w_chunks\"(size, validity, rowids) VALUES (?, ?, ?);\x00INSERT INTO \"%w\".\"%w_vector_chunks%02d\"(_rowid_, rowid, vectors)VALUES (?, ?, ?)\x00INSERT INTO \"%w\".\"%w_metadatachunks%02d\"(_rowid_, rowid, data)VALUES (?, ?, ?)\x00vec0 constructor error: could not parse vector column '%s'\x00vec0 constructor error: Too many provided vector columns, maximum %d\x00vec0 constructor error: Dimension on vector column too large, provided %lld, maximum %lld\x00vec0 constructor error: More than %d partition key columns were provided\x00vec0 constructor error: More than one primary key definition was provided, vec0 only suports a single primary key column\x00vec0 constructor error: More than %d auxiliary columns were provided\x00vec0 constructor error: More than %d metadata columns were provided\x00vec0 constructor error: could not parse table option '%s'\x00chunk_size\x00vec0 constructor error: chunk_size must be a non-zero positive integer\x00vec0 constructor error: chunk_size must be divisible by 8\x00vec0 constructor error: chunk_size too large\x00vec0 constructor error: Unknown table option: %.*s\x00vec0 constructor error: Could not parse '%s'\x00vec0 constructor error: At least one vector column is required\x00CREATE TABLE x(\x00\"%.*w\" primary key, \x00rowid, \x00\"%.*w\", \x00 distance hidden, k hidden) \x00without rowid \x00vec0 constructor error: could not declare virtual table, '%s'\x00%s\x00%s_rowids\x00%s_chunks\x00%s_vector_chunks%02d\x00%s_metadatachunks%02d\x00CREATE TABLE \"%w\".\"%w_info\" (key text primary key, value any)\x00Could not create '_info' shadow table: %s\x00INSERT INTO \"%w\".\"%w_info\"(key, value) VALUES (?1, ?2), (?3, ?4), (?5, ?6), (?7, ?8) \x00Could not seed '_info' shadow table: %s\x00CREATE_VERSION\x00v0.1.9\x00CREATE_VERSION_MAJOR\x00CREATE_VERSION_MINOR\x00CREATE_VERSION_PATCH\x00CREATE TABLE \"%w\".\"%w_chunks\"(\x00chunk_id INTEGER PRIMARY KEY AUTOINCREMENT,size INTEGER NOT NULL,\x00sequence_id integer,\x00partition%02d,\x00validity BLOB NOT NULL, rowids BLOB NOT NULL);\x00CREATE TABLE \"%w\".\"%w_chunks\"(chunk_id INTEGER PRIMARY KEY AUTOINCREMENT,size INTEGER NOT NULL,validity BLOB NOT NULL,rowids BLOB NOT NULL);\x00Could not create '_chunks' shadow table: %s\x00CREATE TABLE \"%w\".\"%w_rowids\"(rowid INTEGER PRIMARY KEY AUTOINCREMENT,id TEXT UNIQUE NOT NULL,chunk_id INTEGER,chunk_offset INTEGER);\x00CREATE TABLE \"%w\".\"%w_rowids\"(rowid INTEGER PRIMARY KEY AUTOINCREMENT,id,chunk_id INTEGER,chunk_offset INTEGER);\x00Could not create '_rowids' shadow table: %s\x00CREATE TABLE \"%w\".\"%w_vector_chunks%02d\"(rowid PRIMARY KEY,vectors BLOB NOT NULL);\x00Could not create '_vector_chunks%02d' shadow table: %s\x00CREATE TABLE \"%w\".\"%w_metadatachunks%02d\"(rowid PRIMARY KEY, data BLOB NOT NULL);\x00Could not create '_metata_chunks%02d' shadow table: %s\x00CREATE TABLE \"%w\".\"%w_metadatatext%02d\"(rowid PRIMARY KEY, data TEXT);\x00Could not create '_metadatatext%02d' shadow table: %s\x00CREATE TABLE \"%w\".\"%w_auxiliary\"( rowid integer PRIMARY KEY \x00, value%02d\x00Could not create auxiliary shadow table: %s\x00DROP TABLE \"%w\".\"%w_chunks\"\x00could not drop chunks shadow table\x00DROP TABLE \"%w\".\"%w_info\"\x00could not drop info shadow table\x00DROP TABLE \"%w\".\"%w_rowids\"\x00DROP TABLE \"%w\".\"%w\"\x00DROP TABLE \"%w\".\"%w_auxiliary\"\x00DROP TABLE \"%w\".\"%w_metadatachunks%02d\"\x00DROP TABLE \"%w\".\"%w_metadatatext%02d\"\x00only 1 MATCH operator is allowed in a single vec0 query\x00only 1 'rowid in (..)' operator is allowed in a single vec0 query\x00A LIMIT or 'k = ?' constraint is required on vec0 knn queries.\x00Only LIMIT or 'k =?' can be provided, not both\x00Only a single 'ORDER BY distance' clause is allowed on vec0 KNN queries\x00Only a single 'ORDER BY distance' clause is allowed on vec0 KNN queries, not on other columns\x00Only ascending in ORDER BY distance clause is supported, DESC is not supported yet.\x00An illegal WHERE constraint was provided on a vec0 auxiliary column in a KNN query.\x00'xxx in (...)' is only available on INTEGER or TEXT metadata columns.\x00An illegal WHERE constraint was provided on a vec0 metadata column in a KNN query. Only one of EQUALS, GREATER_THAN, LESS_THAN_OR_EQUAL, LESS_THAN, GREATER_THAN_OR_EQUAL, NOT_EQUALS is allowed.\x00ONLY EQUALS (=) or NOT_EQUALS (!=) operators are allowed on boolean metadata columns.\x00Illegal WHERE constraint on distance column in a KNN query. Only one of GT, GE, LT, LE constraints are allowed.\x00select data from \"%w\".\"%w_metadatatext%02d\" where rowid = ?\x00select chunk_id, validity, rowids  from \"%w\".\"%w_chunks\"\x00 WHERE \x00 partition%02d > ? \x00 partition%02d <= ? \x00 partition%02d < ? \x00 partition%02d >= ? \x00 partition%02d != ? \x00rowids\x00chunks iter error\x00chunk validity size doesn't match - expected %lld, found %lld\x00rowids size doesn't match\x00chunk rowids size doesn't match - expected %lld, found %lld\x00could not open vectors blob for chunk %lld\x00vectors blob size doesn't match - expected %lld, found %lld\x00vectors blob read error for %lld\x00Could not open metadata blob\x00Could not filter metadata fields\x00Query vector on the \"%.*s\" column is invalid: %z\x00Query vector for the \"%.*s\" column is expected to be of type %s, but a %s vector was provided.\x00Dimension mismatch for query vector for the \"%.*s\" column. Expected %d dimensions but received %d.\x00k value in knn queries must be greater than or equal to 0.\x00k value in knn query too large, provided %lld and the limit is %lld\x00error processing rowid in (...) array\x00Error fetching next value in `x in (...)` integer expression\x00Error fetching next value in `x in (...)` text expression\x00Internal sqlite-vec error\x00Error preparing stmtChunk: %s\x00 SELECT rowid  FROM \"%w\".\"%w_rowids\" ORDER by chunk_id, chunk_offset \x00Error preparing rowid scan: %s\x00unknown idxStr '%s'\x00Internal sqlite-vec error: expected point query plan in vec0Rowid, found %d\x00Internal sqlite-vec error: fullscan_data is NULL.\x00Could not extract metadata value for column %.*s at rowid %lld\x00Internal sqlite-vec error: point_data is NULL.\x00Internal sqlite-vec error: knn_data is NULL.\x00The %s virtual table was declared with a TEXT primary key, but a non-TEXT value was provided in an INSERT.\x00Only integers are allows for primary key values on %s\x00validity\x00Internal sqlite-vec error: could not open validity blob on %s.%s.%lld\x00Internal sqlite-vec error: validity blob size mismatch on %s.%s.%lld, expected %lld but received %lld.\x00Internal sqlite-vec error: Could not allocate memory for validity bitmap\x00Internal sqlite-vec error: Could not read validity bitmap for %s.%s.%lld\x00Internal sqlite-vec error: Could not insert a new vector chunk\x00Internal sqlite-vec error: unknown error, blobChunksValidity could not be closed, please file an issue.\x00Internal sqlite-vec error: Could not open validity blob for newly created chunk %s.%s.%lld\x00Internal sqlite-vec error: validity blob size mismatch for newly created chunk %s.%s.%lld. Exepcted %lld, got %lld\x00Internal sqlite-vec error: could not read validity blob newly created chunk %s.%s.%lld\x00Internal sqlite-vec error: could not mark validity bit \x00Error opening vector blob at %s.%s.%lld\x00Internal sqlite-vec error: vector blob size mismatch on %s.%s.%lld. Expected %lld, actual %lld\x00Internal sqlite-vec error: could not write vector blob on %s.%s.%lld\x00Internal sqlite-vec error: could not close vector blob on %s.%s.%lld\x00Internal sqlite-vec error: could not open rowids blob on %s.%s.%lld\x00Internal sqlite-vec error: rowids blob size mismatch on %s.%s.%lld. Expected %lld, actual %lld\x00Internal sqlite-vec error: could not write rowids blob on %s.%s.%lld\x00Internal sqlite-vec error: could not close rowids blob on %s.%s.%lld\x00Expected 0 or 1 for BOOLEAN metadata column %.*s\x00Expected integer for INTEGER metadata column %.*s, received %s\x00Expected float for FLOAT metadata column %.*s, received %s\x00Expected text for TEXT metadata column %.*s, received %s\x00UPDATE \"%w\".\"%w_metadatatext%02d\" SET data = ?2 WHERE rowid = ?1\x00INSERT INTO \"%w\".\"%w_metadatatext%02d\" (rowid, data) VALUES (?1, ?2)\x00DELETE FROM \"%w\".\"%w_metadatatext%02d\" WHERE rowid = ?\x00Parition key type mismatch: The partition key column %.*s has type %s, but %s was provided.\x00Inserted vector for the \"%.*s\" column is invalid: %z\x00Inserted vector for the \"%.*s\" column is expected to be of type %s, but a %s vector was provided.\x00Dimension mismatch for inserted vector for the \"%.*s\" column. Expected %d dimensions but received %d.\x00A value was provided for the hidden \"distance\" column.\x00A value was provided for the hidden \"k\" column.\x00INSERT INTO \"%w\".\"%w_auxiliary\"(rowid \x00) VALUES (? \x00Auxiliary column type mismatch: The auxiliary column %.*s has type %s, but %s was provided.\x00Internal sqlite-vec error: unknown error, blobChunksValidity could not be closed, please file an issue\x00could not open validity blob for %s.%s.%lld\x00could not read validity blob for %s.%s.%lld at %d\x00vec0 deletion error: validity bit is not set for %s.%s.%lld at %d\x00could not write to validity blob for %s.%s.%lld at %d\x00vec0 deletion error: Error commiting validity blob transaction on %s.%s.%lld at %d\x00could not open rowids blob for %s.%s.%lld\x00could not write to rowids blob for %s.%s.%lld at %llu\x00vec0 deletion error: Error commiting rowids blob transaction on %s.%s.%lld at %llu\x00could not open vector blob for %s.%s.%lld column %d\x00could not write to vector blob for %s.%s.%lld at %llu column %d\x00vec0 deletion error: Error commiting vector blob transaction on %s.%s.%lld column %d\x00could not open validity blob for chunk %lld\x00DELETE FROM \"%w\".\"%w_chunks\" WHERE rowid = ?\x00DELETE FROM \"%w\".\"%w_vector_chunks%02d\" WHERE rowid = ?\x00DELETE FROM \"%w\".\"%w_metadatachunks%02d\" WHERE rowid = ?\x00DELETE FROM \"%w\".\"%w_rowids\" WHERE rowid = ?\x00DELETE FROM \"%w\".\"%w_auxiliary\" WHERE rowid = ?\x00UPDATE \"%w\".\"%w_auxiliary\" SET value%02d = ? WHERE rowid = ?\x00Updated vector for the \"%.*s\" column is invalid: %z\x00Updated vector for the \"%.*s\" column is expected to be of type %s, but a %s vector was provided.\x00Dimension mismatch for new updated vector for the \"%.*s\" column. Expected %d dimensions but received %d.\x00Could not open vectors blob for %s.%s.%lld\x00Could not write to vectors blob for %s.%s.%lld\x00Could not commit blob transaction for vectors blob for %s.%s.%lld\x00UPDATEs on vec0 primary key values are not allowed.\x00UPDATE on partition key columns are not supported yet. \x00Unrecognized xUpdate operation provided for vec0.\x00chunks\x00auxiliary\x00info\x00metadatachunks00\x00metadatachunks01\x00metadatachunks02\x00metadatachunks03\x00metadatachunks04\x00metadatachunks05\x00metadatachunks06\x00metadatachunks07\x00metadatachunks08\x00metadatachunks09\x00metadatachunks10\x00metadatachunks11\x00metadatachunks12\x00metadatachunks13\x00metadatachunks14\x00metadatachunks15\x00metadatatext00\x00metadatatext01\x00metadatatext02\x00metadatatext03\x00metadatatext04\x00metadatatext05\x00metadatatext06\x00metadatatext07\x00metadatatext08\x00metadatatext09\x00metadatatext10\x00metadatatext11\x00metadatatext12\x00metadatatext13\x00metadatatext14\x00metadatatext15\x00vec0-static_blob_def\x00CREATE TABLE x(name, data, dimensions hidden, count hidden)\x00CREATE TABLE x(vector, distance hidden, k hidden)\x00ORDER BY distance required\x00more than 1 ORDER BY clause provided\x00ORDER BY must be on the distance column\x00vec_version\x00vec_debug\x00Version: v0.1.9\nDate: \nCommit: \nBuild flags:  \x00vec_distance_l2\x00vec_distance_l1\x00vec_distance_hamming\x00vec_distance_cosine\x00vec_length\x00vec_type\x00vec_to_json\x00vec_add\x00vec_sub\x00vec_slice\x00vec_normalize\x00vec_f32\x00vec_bit\x00vec_int8\x00vec_quantize_int8\x00vec_quantize_binary\x00vec0\x00vec_each\x00Error creating function %s: %s\x00Error creating module %s: %s\x00vec_npy_file\x00vec_npy_each\x00vec_static_blob_from_raw\x00vec_static_blobs\x00vec_static_blob_entries\x00"

var _aFunc = [16]struct {
	FzFName uintptr
	FxFunc  uintptr
	FnArg   int32
	Fflags  int32
}{
	0: {
		FzFName: __ccgo_ts + 16176,
		FnArg:   int32(2),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE),
	},
	1: {
		FzFName: __ccgo_ts + 16192,
		FnArg:   int32(2),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE),
	},
	2: {
		FzFName: __ccgo_ts + 16208,
		FnArg:   int32(2),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE),
	},
	3: {
		FzFName: __ccgo_ts + 16229,
		FnArg:   int32(2),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE),
	},
	4: {
		FzFName: __ccgo_ts + 16249,
		FnArg:   int32(1),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE),
	},
	5: {
		FzFName: __ccgo_ts + 16260,
		FnArg:   int32(1),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC),
	},
	6: {
		FzFName: __ccgo_ts + 16269,
		FnArg:   int32(1),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE) | libc.Int32FromInt32(m_SQLITE_RESULT_SUBTYPE),
	},
	7: {
		FzFName: __ccgo_ts + 16281,
		FnArg:   int32(2),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE) | libc.Int32FromInt32(m_SQLITE_RESULT_SUBTYPE),
	},
	8: {
		FzFName: __ccgo_ts + 16289,
		FnArg:   int32(2),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE) | libc.Int32FromInt32(m_SQLITE_RESULT_SUBTYPE),
	},
	9: {
		FzFName: __ccgo_ts + 16297,
		FnArg:   int32(3),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE) | libc.Int32FromInt32(m_SQLITE_RESULT_SUBTYPE),
	},
	10: {
		FzFName: __ccgo_ts + 16307,
		FnArg:   int32(1),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE) | libc.Int32FromInt32(m_SQLITE_RESULT_SUBTYPE),
	},
	11: {
		FzFName: __ccgo_ts + 16321,
		FnArg:   int32(1),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE) | libc.Int32FromInt32(m_SQLITE_RESULT_SUBTYPE),
	},
	12: {
		FzFName: __ccgo_ts + 16329,
		FnArg:   int32(1),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE) | libc.Int32FromInt32(m_SQLITE_RESULT_SUBTYPE),
	},
	13: {
		FzFName: __ccgo_ts + 16337,
		FnArg:   int32(1),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE) | libc.Int32FromInt32(m_SQLITE_RESULT_SUBTYPE),
	},
	14: {
		FzFName: __ccgo_ts + 16346,
		FnArg:   int32(2),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE) | libc.Int32FromInt32(m_SQLITE_RESULT_SUBTYPE),
	},
	15: {
		FzFName: __ccgo_ts + 16364,
		FnArg:   int32(1),
		Fflags:  libc.Int32FromInt32(m_SQLITE_UTF8) | libc.Int32FromInt32(m_SQLITE_INNOCUOUS) | libc.Int32FromInt32(m_SQLITE_DETERMINISTIC) | libc.Int32FromInt32(m_SQLITE_SUBTYPE) | libc.Int32FromInt32(m_SQLITE_RESULT_SUBTYPE),
	},
}

var _aMod = [2]struct {
	Fname     uintptr
	Fmodule   uintptr
	Fp        uintptr
	FxDestroy uintptr
}{
	0: {
		Fname:   __ccgo_ts + 16384,
		Fmodule: uintptr(unsafe.Pointer(&_vec0Module)),
	},
	1: {
		Fname:   __ccgo_ts + 16389,
		Fmodule: uintptr(unsafe.Pointer(&_vec_eachModule)),
	},
}

func _vec_to_json(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
	bp := tls.Alloc(64)
	defer tls.Free(64)
	var b Tu8
	var i Tsize_t
	var len1, rc int32
	var s, str uintptr
	var value Tf32
	var _ /* cleanup at bp+16 */ Tvector_cleanup
	var _ /* dimensions at bp+8 */ Tsize_t
	var _ /* elementType at bp+32 */ _VectorElementType
	var _ /* err at bp+24 */ uintptr
	var _ /* vector at bp+0 */ uintptr
	_, _, _, _, _, _, _ = b, i, len1, rc, s, str, value
	rc = Xvector_from_value(tls, **(**uintptr)(__ccgo_up(argv)), bp, bp+8, bp+32, bp+16, bp+24)
	if rc != m_SQLITE_OK {
		libsqlite3.Xsqlite3_result_error(tls, context, **(**uintptr)(__ccgo_up(bp + 24)), -int32(1))
		libsqlite3.Xsqlite3_free(tls, **(**uintptr)(__ccgo_up(bp + 24)))
		return
	}
	str = libsqlite3.Xsqlite3_str_new(tls, libsqlite3.Xsqlite3_context_db_handle(tls, context))
	libsqlite3.Xsqlite3_str_appendall(tls, str, __ccgo_ts+1671)
	i = uint64(0)
	for {
		if !(i < **(**Tsize_t)(__ccgo_up(bp + 8))) {
			break
		}
		if i != uint64(0) {
			libsqlite3.Xsqlite3_str_appendall(tls, str, __ccgo_ts+1673)
		}
		if **(**_VectorElementType)(__ccgo_up(bp + 32)) == int32(_SQLITE_VEC_ELEMENT_TYPE_FLOAT32) {
			value = **(**Tf32)(__ccgo_up(**(**uintptr)(__ccgo_up(bp)) + uintptr(i)*4))
			if libc.X__isnanf(tls, value) != 0 {
				libsqlite3.Xsqlite3_str_appendall(tls, str, __ccgo_ts+1675)
			} else {
				libsqlite3.Xsqlite3_str_appendf(tls, str, __ccgo_ts+1680, libc.VaList(bp+48, float64(value)))
			}
		} else {
			if **(**_VectorElementType)(__ccgo_up(bp + 32)) == int32(_SQLITE_VEC_ELEMENT_TYPE_INT8) {
				libsqlite3.Xsqlite3_str_appendf(tls, str, __ccgo_ts+1683, libc.VaList(bp+48, int32(**(**Ti8)(__ccgo_up(**(**uintptr)(__ccgo_up(bp)) + uintptr(i))))))
			} else {
				if **(**_VectorElementType)(__ccgo_up(bp + 32)) == int32(_SQLITE_VEC_ELEMENT_TYPE_BIT) {
					b = libc.Uint8FromInt32(libc.Int32FromUint8(**(**Tu8)(__ccgo_up(**(**uintptr)(__ccgo_up(bp)) + uintptr(i/uint64(8))))) >> (i % uint64(m_CHAR_BIT)) & int32(1))
					libsqlite3.Xsqlite3_str_appendf(tls, str, __ccgo_ts+1683, libc.VaList(bp+48, libc.Int32FromUint8(b)))
				}
			}
		}
		goto _1
	_1:
		;
		i = i + 1
	}
	libsqlite3.Xsqlite3_str_appendall(tls, str, __ccgo_ts+1686)
	len1 = libsqlite3.Xsqlite3_str_length(tls, str)
	s = libsqlite3.Xsqlite3_str_finish(tls, str)
	if s != 0 {
		libsqlite3.Xsqlite3_result_text(tls, context, s, len1, __ccgo_fp(libsqlite3.Xsqlite3_free))
		libsqlite3.Xsqlite3_result_subtype(tls, context, uint32(m_JSON_SUBTYPE))
	} else {
		libsqlite3.Xsqlite3_result_error_nomem(tls, context)
	}
	(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(bp + 16)))(tls, **(**uintptr)(__ccgo_up(bp)))
}

type blkcnt_t = Tblkcnt_t

type blksize_t = Tblksize_t

type caddr_t = Tcaddr_t

type clock_t = Tclock_t

type clockid_t = Tclockid_t

type cpuid_t = Tcpuid_t

type daddr_t = Tdaddr_t

type fixpt_t = Tfixpt_t

type fsblkcnt_t = Tfsblkcnt_t

type fsfilcnt_t = Tfsfilcnt_t

type gid_t = Tgid_t

type ino_t = Tino_t

type key_t = Tkey_t

const m_BC_BASE_MAX = "INT_MAX"

const m_BC_DIM_MAX = 65535

const m_BC_SCALE_MAX = "INT_MAX"

const m_BC_STRING_MAX = "INT_MAX"

const m_BYTE_ORDER = "_BYTE_ORDER"

const m_FP_ILOGBNAN = "INT_MAX"

const m_LINK_MAX = 32767

const m_LONG_MAX = 9223372036854775807

const m_NGROUPS_MAX = 16

const m_NL_LANGMAX = 14

const m_QUAD_MAX = 0x7fffffffffffffff

const m_SCHAR_MAX = 0x7f

const m_SIZE_T_MAX = "ULONG_MAX"

const m_SQLITE_VEC_DATE = ""

const m_UCHAR_MAX = 0xff

const m_ULLONG_MAX = "0xffffffffffffffffU"

const m_ULONG_MAX = 0xffffffffffffffff

const m_UQUAD_MAX = "0xffffffffffffffffU"

const m__BIG_ENDIAN = 4321

const m__BYTE_ORDER = "_LITTLE_ENDIAN"

const m__LITTLE_ENDIAN = 1234

const m__PDP_ENDIAN = 3412

type nlink_t = Tnlink_t

type qdiv_t = Tqdiv_t

type quad_t = Tquad_t

type segsz_t = Tsegsz_t

type suseconds_t = Tsuseconds_t

type t__in_addr_t = uint32

type t__in_port_t = uint16

type t__mode_t = uint32

type t__wctrans_t = uintptr

type t__wctype_t = uintptr

type timer_t = Ttimer_t

type u_char = Tu_char

type u_int = Tu_int

type u_long = Tu_long

type u_quad_t = Tu_quad_t

type u_short = Tu_short

type uint = Tuint

type ulong = Tulong

type unchar = Tunchar

type useconds_t = Tuseconds_t

type ushort = Tushort
