surrealdb.node icon indicating copy to clipboard operation
surrealdb.node copied to clipboard

No typescript types and different response shapes between packages

Open sebastianwessel opened this issue 1 year ago • 0 comments

First: 👏 great job - cool product and lib's!

The surrealdb.js package already provides typings for results like this:

query: <T extends RawQueryResult[]>(
		query: string,
		vars?: Record<string, unknown>,
	) => Promise<MapQueryResult<T>>;

Would be awesome if this would also become available in surrealdb.node.

Also, there is a difference in the response shapes of surrealdb.node, surrealdb.wasm and surrealdb.js

The surrealdb.js package provides a result like this:

[
  {
    status: string
    result?: <result type>
  } 
]

while surrealdb.node and surrealdb.wasm is returning a less deep, structured response like this:

[
   <result type>
]

It would be great if this becomes aligned across all the different cool packages.

sebastianwessel avatar Sep 19 '23 17:09 sebastianwessel