Confusing Data Structure

So , currently i working on NextJS 15 and using AuthJS when i get a data from xata using @xata.io/client": "^0.30.1 , the result was
{
id: 'rec_cvt761e293clmhh9jajg',
name: 'Hello',
xata_createdat: null,
xata_id: null,
xata_updatedat: null,
xata_version: null,
xata: {
createdAt: 2025-04-12T14:04:53.275Z,
updatedAt: 2025-04-12T14:04:53.275Z,
}
}
{
id: 'rec_cvt761e293clmhh9jajg',
name: 'Hello',
xata_createdat: null,
xata_id: null,
xata_updatedat: null,
xata_version: null,
xata: {
createdAt: 2025-04-12T14:04:53.275Z,
updatedAt: 2025-04-12T14:04:53.275Z,
}
}
when i try to submit a data , it said Error: invalid record: column [xata_id]: column not found when i get a data from xata using @xata.io/client@next , the result was
{
name: 'World',
xata_createdat: 2025-04-12T14:04:34.536Z,
xata_id: 'rec_cvt75sm293clmhh9jai0',
xata_updatedat: 2025-04-12T14:04:34.536Z,
xata_version: 0
}
{
name: 'World',
xata_createdat: 2025-04-12T14:04:34.536Z,
xata_id: 'rec_cvt75sm293clmhh9jai0',
xata_updatedat: 2025-04-12T14:04:34.536Z,
xata_version: 0
}
when i try to submit a data it working fine , but it broke the AuthJS adapter
[auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror
[auth][cause]: Error: invalid record: column [user]: type mismatch: expected string
[auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror
[auth][cause]: Error: invalid record: column [user]: type mismatch: expected string
Also is there any way for disabling the direct access for postgres ? when i create a database there is no swicth for it and auto enabling it.
5 Replies
cmck
cmck7d ago
Hi there, I appreciate this is a confusing error. The xata_id column error is a hangover from the non-postgres-enabled database. Some of our operations (such as bulk upsert) expect a xata_id column, and not id. We're working on fixing/streamlining this issue. As for the postgres-enabled database, this is the default and only option moving forward. You cannot disable this feature. If you need the functionality of the non-postgres-enabled database (files columns on the Pro tier, for example) you can disable the Native SQL Table option in the database settings.
No description
Avux アリャ
Avux アリャOP6d ago
great , waiting for the update of column error , thanks.
cmck
cmck6d ago
Could you tell me what method you were using to insert the data? With a code snippet, if possible.
Avux アリャ
Avux アリャOP6d ago
srry, i cant give the code snippet bcs im using AuthJS with Xata Adapter. so i doesnt know which method that the adapter use for inserting data. but for the others i use, createOrUpdate and it working finely without any problems.
cmck
cmck6d ago
No problem, makes sense that createOrUpdate would work thanks for confirming.

Did you find this page helpful?