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
DEFINE TABLE IF NOT EXISTS user SCHEMAFULL;
DEFINE FIELD name ON user TYPE string;
DEFINE FIELD address ON user TYPE record<address>;
DEFINE TABLE IF NOT EXISTS address SCHEMAFULL;
DEFINE FIELD street ON address TYPE string;
DEFINE FIELD numberON address TYPE string;
At the moment if we want to create a user with a address we have to:
CREATEuserCONTENT {
name: "Test User",
address: { # line picks up that this is address from the schema
street: "test",
number: "123"
}
}
CREATE|Update user CONTENT {
name: "Test User",
address: {
id: address:1, # line picks up that this is address from the id
street: "test",
number: "123"
}
}
Is your feature request related to a problem?
No
Describe the solution
Say we have this schema below
At the moment if we want to create a user with a address we have to:
Proposing auto create/update like so:
Alternative methods
Just doing it manually
SurrealDB version
1.4.2
Contact Details
lindelwencube.ln@gmail.com
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: