Feature - Use enum to pick index method
See original GitHub issueIt would be nice to have an overload of
.ForNpgsqlHasMethod("gin");
that accepts an enum value. Primarily for intellisensability. (I would do this, if approved)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Using an enum as an array index
It is perfectly normal to use an enum for indexing into an array. You don't have to specify each enum value, they will...
Read more >Obtaining Enum Elements in String Format - NI - Support
This property returns an array of strings for all items of the specified enum. In case you want to pick only the currently...
Read more >enum in Java
Loop through Enum We can iterate over the Enum using values( ) and loop. values() function returns an array of Enum values as...
Read more >Build Enumerations of Constants With Python's Enum
In this tutorial, you'll learn how to create and use enumerations of semantically related constants in Python. To do this, you'll use the ......
Read more >ENUM - MariaDB Knowledge Base
ENUM values are indexed numerically in the order they are defined, and sorting will be performed in this numeric order. We suggest not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There are already various other places where PostgreSQL lists of values are specified as strings - notably types (e.g. when users specify
HasStoreType()
). We can start wrapping all of these with enums and similar, but the value seems rather limited and we’d have to update these as PostgreSQL adds new ones…In general it seems preferable for users to consult the PostgreSQL documentation to know these values - at the very least we should point them towards the right page from the xmldocs.
@austindrenski thanks for the good responses above, here’s some more from me.
Thanks for saying that! That’s also good to hear.
On the issue of index method enums, it’s worth saying I’m not totally against the idea. However:
On the specific questions, to supplement @austindrenski’s responses:
This has actually been unblocked at the EF Core side, I’m not actually sure we need to do anything to make it work in Npgsql (but obviously testing is needed).
The HiLo feature seems to be very rarely used (not just with PostgreSQL, but in general in EF Core), and this is the first time anyone has raised the lack of support for specifying the starting value. See my comment at the bottom about eagerly implementing features without a clear need, but if you’d like you can open an issue for this.
This is tracked by #819 and will hopefully make it into 3.0.0.
I’m not sure I understand the question - is this a general EF Core question on how EnsureCreated() interacts with migrations? It doesn’t seem to be specific to the Npgsql provider.
Very much agree - our docs could definitely use some work. It’s not always easy to keep them in sync with actual features, and it’s possibly a good place for contributors to start as they’re exploring/discovering the provider.
Agree as well - the range of features is potentially extremely large, and you can see the same issue in Microsoft-developed providers as well (e.g. SQL Server / Sqlite). In some cases we are also limited by upstream EF Core, but in general this is an open source project maintained by the community.
As a general rule, I personally try to avoid rushing into feature implementation without users asking for them, or without a plausible reason to believe it would be useful. In this project it’s very easy to fall into the trap of eagerly implementing tons of features and translations with the goal of being feature-complete (and because it’s fun/interesting), but which almost nobody will use, and which we then have to maintain. So while it may sound odd, I’d say feature-completeness isn’t exactly an explicit goal.
If you see anything you’re interested in it would definitely be great to have you (and anyone else) as a contributor!