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

How to Create an Indexed Column? #3

Open
celestialorb opened this issue Nov 22, 2024 · 0 comments
Open

How to Create an Indexed Column? #3

celestialorb opened this issue Nov 22, 2024 · 0 comments

Comments

@celestialorb
Copy link

I'm unable to figure out how to create an indexed column as part of the schema for a table.

I imagine it could be something as simple as:

using ObjectTable = zxorm::Table<"objects", Object,
    zxorm::Column<"id", &Object::id, zxorm::PrimaryKey<>>,
    zxorm::Column<"indexed_column", &Object::id, zxorm::Index<>>,
    zxorm::Column<"some_text", &Object::some_text>
>;

In a somewhat related issue as well, I can't figure out how to create a table without a primary key, or with an auto-incrementing primary key. If I remove the zxorm::PrimaryKey<> specification from the id column I end up with compiler errors.

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

No branches or pull requests

1 participant