Skip to content

Commit a5aa679

Browse files
committed
Update README.md
1 parent a804318 commit a5aa679

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ sqldelight {
2828
```
2929

3030
```sql
31+
32+
CREATE TABLE items (
33+
id BIGSERIAL PRIMARY KEY,
34+
embedding VECTOR(3)
35+
);
36+
37+
CREATE INDEX idx_embedding_hnsw ON items USING hnsw (embedding vector_l2_ops);
38+
39+
CREATE INDEX idx_embedding_ivfflat ON items USING ivfflat (embedding vector_l2_ops) WITH (lists = 100);
40+
3141
insert:
3242
INSERT INTO items (embedding) VALUES ('[1,2,3]'), ('[4,5,6]');
3343

@@ -46,20 +56,20 @@ SELECT subvector(?::VECTOR, 1, 3);
4656

4757
selectCosineDistance:
4858
SELECT cosine_distance('[1,1]'::VECTOR, '[-1,-1]');
59+
60+
selectBinaryQuantize:
61+
SELECT binary_quantize('[0,0.1,-0.2,-0.3,0.4,0.5,0.6,-0.7,0.8,-0.9,1]'::VECTOR);
4962
```
5063

5164
**TODO**
5265

5366
Query Operators https://github.com/pgvector/pgvector/tree/master?tab=readme-ov-file#querying
5467

55-
5668
There are problems extending an existing grammar through more than one level of inheritance. This would require fixes to
57-
https://github.com/sqldelight/Grammar-Kit-Composer
69+
https://github.com/sqldelight/Grammar-Kit-Composer - Such that, when adding to an existing type (e.g. data type) concatenation of PostgreSql types is required
5870

5971
SqlDelight needs this fix https://github.com/sqldelight/sqldelight/pull/5625 for the module resolver to be the first
6072

61-
Duplication of PostgreSql data types are required unless external parser rules are created manually
62-
6373
PostgreSqlTypeResolver needs to be inherited rather than use delegation as needs polymorphic calls
6474

6575

0 commit comments

Comments
 (0)