Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[FEATURE]: Implement CREATE VECTOR INDEX for MySQL #3695

Open
1 task done
emmerich opened this issue Dec 5, 2024 · 0 comments
Open
1 task done

[FEATURE]: Implement CREATE VECTOR INDEX for MySQL #3695

emmerich opened this issue Dec 5, 2024 · 0 comments
Labels

Comments

@emmerich
Copy link

emmerich commented Dec 5, 2024

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

MySQL 9.0 is shipping with the VECTOR column type. Some MySQL providers have already start giving early access too. Additionally, Oracle has documented a VECTOR INDEX in the new version: https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-vector-index.html

PlanetScale also supports this syntax, but there's no way of defining it with Drizzle.

import { datetime, index, mediumtext, mysqlTable, varchar } from 'drizzle-orm/mysql-core';

const myTable = mysqlTable('my_table', {
  // a custom type implementing the VECTOR column type
  embedding: vector('embedding', { length: 1024 }),
}, (table) => ({
  embeddingIdx: vectorIndex('embedding_idx').on(table.embedding),
});

Equivalent SQL:

CREATE VECTOR INDEX embedding_idx ON my_table(embedding);

It's currently not possible even if trying to use raw SQL to define the index, so it's a bit of a blocker.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants