surrealdb / surrealdb.java

SurrealDB SDK for Java
https://surrealdb.com
Apache License 2.0
67 stars 21 forks source link

Feature: Select Model without using Record-IDs #64

Closed 047massi closed 1 week ago

047massi commented 1 year ago

Is your feature request related to a problem?

Select a Model by using e.g. a Username instead of a Record ID

Describe the solution

i think it would be better to select a model by like using a username from a column instead to use a record id.

Alternative methods

I came to an idea to add something like a .where("key", "value") method to the end of driver.select(...) Example: User user = driver.select("table", User.class).where("key", "value"))

SurrealDB version

1.0.0-beta.9+20230402.5eafebd for windows on x86_64

Contact Details

No response

Is there an existing issue for this?

Code of Conduct

mnbjhu commented 1 year ago

This is an interesting idea, although I think it's worth mentioning:

emmanuel-keller commented 1 week ago

With version 0.2.0, the select method now has several variants, allowing for the selection of a table. https://surrealdb.github.io/surrealdb.java/javadoc/com/surrealdb/Surreal.html#select(java.lang.Class,java.lang.String)