The generic type T is not used in the return of the .query function:
/**
* Runs a set of SurrealQL statements against the database.
* @param query - Specifies the SurrealQL statements.
* @param bindings - Assigns variables which can be used in the query.
*/
async query<T extends unknown[]>(
query: string | PreparedQuery,
bindings?: Record<string, unknown>,
) {
const raw = await this.query_raw<T>(query, bindings);
return raw.map(({ status, result }) => {
if (status == "ERR") throw new ResponseError(result);
return result;
});
}
This makes it so that i get no types on my result.
Steps to reproduce
Use the latest current version of surrealdb.js and try to specify a type for the .query function.
Expected behaviour
Exptected the result from the function to be of the specified generic type.
SurrealDB version
surreal 1.4.2 for windows
SurrealDB.js version
1.0.0-beta.5
Contact Details
olavnon@gmail.com
Is there an existing issue for this?
[X] I have searched the existing issues
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Describe the bug
The generic type
T
is not used in the return of the.query
function:This makes it so that i get no types on my result.
Steps to reproduce
Use the latest current version of surrealdb.js and try to specify a type for the
.query
function.Expected behaviour
Exptected the result from the function to be of the specified generic type.
SurrealDB version
surreal 1.4.2 for windows
SurrealDB.js version
1.0.0-beta.5
Contact Details
olavnon@gmail.com
Is there an existing issue for this?
Code of Conduct