MySQL Forums
Forum List  »  Connector/Node.js

Node X DevAPI can't getSession() from table
Posted by: Michael Dayah
Date: September 21, 2023 07:53PM

According to https://dev.mysql.com/doc/dev/connector-j/latest/?com/mysql/cj/xdevapi/Session.html

Interface Table inherits from DatabaseObject the getSession() method.

Calling this method on table from Node.js v20.7.0 with @mysql/xdevapi 8.0.33 in the following way

const session = await mysqlx.getSession(config);
const schema = session.getSchema(config.schema);
const table = schema.getTable('property');
const session_from_table_test = await table.getSession();

returns the following error:
/node_modules/@mysql/xdevapi/lib/DevAPI/DatabaseObject.js:56
return session(connection);
^

TypeError: session is not a function

Options: ReplyQuote


Subject
Written By
Posted
Node X DevAPI can't getSession() from table
September 21, 2023 07:53PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.