Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[FEATURE]: default naming convention for index #3836

Open
1 task done
kenn opened this issue Dec 25, 2024 · 0 comments
Open
1 task done

[FEATURE]: default naming convention for index #3836

kenn opened this issue Dec 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@kenn
Copy link

kenn commented Dec 25, 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

(This may be SQLite specific)

Right now the index method from drizzle-orm/sqlite-core requires a name for index:

(t) => [index().on(t.code, t.name)] // => Expected 1 arguments, but got 0.

I've been using my own helper method (wrapper around index and uniqueIndex) to automatically assign it a unique index name such as index_users_code_name, but I've been needing the helper in all of my projects.

I believe ORM should offer a sane and safe default that covers 90% of use cases.

That way, users are only expected to give it a name when they feel they absolutely need it, like when >62 chars.

https://blog.saeloun.com/2023/10/24/rails-index-name-too-long/

@kenn kenn added the enhancement New feature or request label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant