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]: index shorthand syntax #3130

Open
juliusmarminge opened this issue Oct 15, 2024 · 0 comments
Open

[FEATURE]: index shorthand syntax #3130

juliusmarminge opened this issue Oct 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@juliusmarminge
Copy link
Contributor

juliusmarminge commented Oct 15, 2024

Describe what you want

similar to short-hand column syntax but for indexes

mySqlTable(
	"table",
	{
        id: int().primaryKey().autoincrement(),
		fooBar: int(),
	}, 
	(table) => ({
		fooIndex: index().on(table.fooBar) // <-- index name optional
	})
)

would yield (with snake_case config)

create table `table` (
  `id` int not null auto_increment primary key,
  `foo_bar` int,
  key foo_index(`foo_bar`)
);
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