113 questions
1
vote
1
answer
56
views
Seeding Surrealdb Schemafull tables using the Rust sdk
I'm working on an application that embeds a surrealdb database. I'm new to Rust, but this isn't as much of a Rust specific question. How should I go about seeding the database with the schema?
Right ...
0
votes
1
answer
147
views
Creating a static singleton with an async initializer in rust [duplicate]
I'm working with SurrealDb, and in their docs here they implement a singleton. However, when you try to implement the same thing using a RocksDb instance it requires an asynchronous step making that ...
1
vote
0
answers
30
views
Create async function in Rust to save SurrealDB record [duplicate]
I'm new to Rust, but have been programming in several other languages for years. I know y'all love the language, but so far I've been very frustrated doing (what in most languages are) simple and easy ...
1
vote
3
answers
92
views
What is the most efficient way to find the latest updated row?
What is the most efficient way to find the latest updated row on a table with a lot of records (hundreds thousands)?
Is it select * from a_table order by updated_at desc limit 1
Now there are 2000 ...
0
votes
0
answers
38
views
Is it possible to have Unique fields with arrays in SurrealDB?
Can I create an unique index on a field which contains an array?
I tried but it doesn't work as I expected.
E.g. when I try to create a record with statuses = ["one", "two", "...
0
votes
1
answer
47
views
How can I get info from 3 table in one request in surrealQL?
I have 3 tables with data and corresponding intermediate tables:
directions;
services;
responsibles;
directions_services;
services_responsibles;
Example:
select *, ->directions_services->...
0
votes
1
answer
36
views
How To Define Schema Type inside a array thype
i want a schema type like this,
DEFINE TABLE h SCHEMAFULL;
DEFINE FIELD items ON TABLE h TYPE array<object>;
inside this object there should be a type like this
{
active: bool,
key: ...
0
votes
1
answer
104
views
How to select many relate table record in surrealdb
I have a surrealdb schema like this
Now what i need is select all the apis and folders and collection that belong to single workspace
the query that i have is this,
SELECT
->...
0
votes
0
answers
53
views
Efficient Query for Connecting (Indirect) Flights with SurrealDB
I'm testing on SurrealDB and attempting to query data from two tables: airport and flight. Here's the setup:
create |airport:1..10000| set
name = rand::string(5),
country = rand::enum("...
0
votes
1
answer
176
views
Surreal db Rust sdk , insert an object that has a record from other object
in Surreal db i have 2 tables: category & product
DEFINE TABLE category SCHEMALESS;
DEFINE FIELD name ON category TYPE string;
DEFINE TABLE product SCHEMALESS;
DEFINE FIELD name ON product TYPE ...
2
votes
1
answer
51
views
Aggregating into lists
Say whe have the following animals:
INSERT INTO animal (id, species, age)
VALUES ("titi", "cat", 3), ("mimi", "cat", 4), ("kiki", "dog", 5)...
0
votes
1
answer
46
views
How to select only nodes having a relative satisfying some property?
Imagine the following situation:
INSERT INTO dog (id, age) VALUES ("mr_whaf", 8), ("mrs_whaf", 3), ("whaf_jr", 0), ("whaf_whaf", 1);
RELATE [dog:mr_whaf, dog:...
0
votes
1
answer
211
views
can't connect to local db for surrealdb
I have surrealdb running in docker like so
docker run --rm --pull always --name surrealdb -p 0.0.0.0:8000:8000 surrealdb/surrealdb:latest start --log debug --user root --pass root memory
and a node ...
1
vote
2
answers
263
views
insert datetime value to surrealdb table whith python
I want insert this:
{'date': '2023-07-03T07:18:52.841147', 'open': 27430.0, 'high': 27730.0, 'low': 27420.0, 'close': 27720.0, 'final': 27490.0, 'y_final': 27190.0, 'vol': 713407.0, 'val': 19755901740....
0
votes
1
answer
204
views
SurrealDB filter nested array with multiple conditions on same element
Here is a sample record for a SurrealDB sandbox database
{
locations: [
{
done: true,
place: 'A',
time: 2
},
{
done: false,
place: 'B',
...