The methods below are used to interact with the database and perform CRUD operations.
You can also use the query method to run SurrealQL statements against the database.
Creating records
If we wish to create a new record in the database, we can use the create method. The first argument
is the table name and the second argument is an associative array with the column names and values.
Selecting records
After when you created a record, you can now use the select method to fetch the newly created person.
The first argument is the newly created person's ID or a string which is the table name.
Or you can fetch it manually by using the RecordID or RecordStringId.
Updating records
To update a record, you can use the update method. The first argument is the RecordID or a StringRecordId,
and the second argument is an associative array with the column names and values. Updating a record can be done if 3 ways:
Deleting records
To delete a record, you can use the delete method. The first argument is the RecordID or a StringRecordId.
or we can use the RecordId or StringRecordId to delete the record.