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
I'm trying to get some data from my surreal database but every queries to tables where there are datetimes return ('no decoder for tag', 12)
Steps to reproduce
Here is the python code to reproduce :
async with AsyncSurrealDB(url=SURREAL_ENDPOINT) as db:
await db.use(SURREAL_NS, SURREAL_DB)
auth_token = await db.sign_in(username=SURREAL_USER, password=SURREAL_PASSWORD)
await db.authenticate(auth_token)
query_result = await db.select("testPy")
print(query_result)
Here is the table definition :
DEFINE TABLE testPy;
DEFINE FIELD name ON testPy TYPE string;
DEFINE FIELD count ON testPy TYPE int;
DEFINE FIELD user ON testPy TYPE record<user>;
-- Tried first without, then with the date :
DEFINE FIELD date ON testPy TYPE datetime;
('no decoder for tag', 12)
Traceback (most recent call last):
File "(...)\server.py", line 86, in <module>
asyncio.run(query())
File "C:\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\asyncio\base_events.py", line 651, in run_until_complete
raise RuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
Expected behaviour
The query should return the data.
SurrealDB version
2.1.4 for linux on x86_64
surrealdb.py version
surrealdb.py 0.4.1 for Windows using Python 3.11.3
Describe the bug
I'm trying to get some data from my surreal database but every queries to tables where there are datetimes return ('no decoder for tag', 12)
Steps to reproduce
Here is the python code to reproduce :
Here is the table definition :
Result :
Without FIELD date on testPy TYPE datetime :
[{'count': 0, 'id': RecordID(table_name=testPy, record_id=ccr4bpvioy08bxugmqul), 'name': 'test', 'user': RecordID(table_name=user, record_id=0b07ec636e914488a67c0198fe36ecce)}]
With FIELD date ON testPy TYPE datetime :
Expected behaviour
The query should return the data.
SurrealDB version
2.1.4 for linux on x86_64
surrealdb.py version
surrealdb.py 0.4.1 for Windows using Python 3.11.3
Contact Details
cto@parte.io
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: