You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it's currently not possible to create a table at runtime because an enum is defining the columns. I'll probably rewrite the library in the following days/weeks to make that possible.
Hey,
thanks for the quick response. Okay, didn't know you could use any type (because there aren't any examples without enums).
Making this an example would be nice, so it is made more obvious that you can use just about any type (that implements the required traits).
One last thing, the examples are just normal rust files, and their corresponding Cargo.toml files are missing. So if you want to run the example locally, you have to write the dependencies yourself. Is this by design? If not, I can, if you want, open a PR and make these quick changes (basically move each example into its rust project)
Activity
Builditluc commentedon Apr 26, 2022
I think it's currently not possible to create a table at runtime because an enum is defining the columns. I'll probably rewrite the library in the following days/weeks to make that possible.
Builditluc commentedon Apr 26, 2022
@gyscos, it seems like you maintain(ed) this library so do know if dynamic tables are possible?
gyscos commentedon Apr 26, 2022
Hi,
Nothing forces you to use an enum as column type. You could use really any type that implements the required traits.
u32would work too.You may need to re-create the table if the columns change though, I have not tested altering the columns when data is already present.
Here is a simple example:
I do agree that it would be a good idea to include that as example.
In addition, the current
Copyconstraint on the key might be removed eventually.Builditluc commentedon Apr 27, 2022
Hey,
thanks for the quick response. Okay, didn't know you could use any type (because there aren't any examples without enums).
Making this an example would be nice, so it is made more obvious that you can use just about any type (that implements the required traits).
One last thing, the examples are just normal rust files, and their corresponding
Cargo.tomlfiles are missing. So if you want to run the example locally, you have to write the dependencies yourself. Is this by design? If not, I can, if you want, open a PR and make these quick changes (basically move each example into its rust project)gyscos commentedon Apr 27, 2022
You can run examples using cargo:
Builditluc commentedon Apr 27, 2022
Okay, didn't know that.
Thanks!