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
{{ message }}
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.
TSError: ⨯ Unable to compile TypeScript:
src/table/index.ts:30:6 - error TS2339: Property 'limit' does not exist on type 'ITableSelect'.
30 .limit(10)
~~~~~
at createTSError (/Users/willin/Documents/shiwangme/trial/mysql8/node_modules/ts-node/src/index.ts:434:12)
at reportTSError (/Users/willin/Documents/shiwangme/trial/mysql8/node_modules/ts-node/src/index.ts:438:19)
at getOutput (/Users/willin/Documents/shiwangme/trial/mysql8/node_modules/ts-node/src/index.ts:578:36)
at Object.compile (/Users/willin/Documents/shiwangme/trial/mysql8/node_modules/ts-node/src/index.ts:775:32)
at Module.m._compile (/Users/willin/Documents/shiwangme/trial/mysql8/node_modules/ts-node/src/index.ts:858:43)
at Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
at Object.require.extensions.<computed> [as .ts] (/Users/willin/Documents/shiwangme/trial/mysql8/node_modules/ts-node/src/index.ts:861:12)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Module.require (internal/modules/cjs/loader.js:1089:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@willin Thank you for pointing out about SQL CRUD Functions.
And yes, SQL CRUD Functions has not been implemented, so the error that you got is expected. Not only it does not have type declaration, the wrapper functions is also not yet implemented, thus will create an error when running TypeScript compiling. We would like to implement the SQL CRUD Functions into mysqlx but it will requires quite some time.
For the time being, instead of changing the imports from mysqlx to @mysql/xdevapi, it would be better to get the native @mysql/xdevapi Table object by calling getXTable() function.
On your case example, it would be:
importmysqlxfrom'mysqlx';// client and session definitionconstxTable=session.getSchema('world_x').getTable('city').getXTable();constselected=awaitxTable.select('ID','Name').limit(10).offset(0).execute();console.log(selected.fetchAll());
def:
main:
err:
change it into
@mysql/xdevapi
, results got:ref docs: https://dev.mysql.com/doc/x-devapi-userguide/en/sql-crud-functions.html#table-select
p.s.
All chainable functions missing type declaration
The text was updated successfully, but these errors were encountered: