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 Oct 10, 2022. It is now read-only.
I have a remote oracle database, first I run npx typeorm-model-generator and filled some database configurations. And at last I got the following errors.
D:\code\ynu\yx_statistics\server>npx typeorm-model-generator
[email protected]
[3:47:20 PM] Using configuration file. [D:\code\ynu\yx_statistics\server\.tomg-config]
[3:47:20 PM] Starting creation of model classes.
Tables not found in selected database. Skipping creation of typeorm model.
Error occurred in typeorm-model-generator.
[email protected][email protected]
If you think this is a bug please open an issue including this log on https://github.com/Kononnable/typeorm-model-generator/issues
[3:47:20 PM] Typeorm model classes created.
I checked the .tomg-config file and the connection part is something like the following.
Notes remote_ip,sid_name,xxx,yyy is some placeholder.
Because the tables I want to generate models is located in another user's tablespace. I tried to modify schemaName to something like USR_ANOTHER.TABLE1,USR_ANOTHER.TABLE2. but it's the same error.
I also tried a write a plain demo and typeorm demo. They all works.
The only important notes is the table name should prefixed with USR_ANOTHER.
demo code
plain oracledb demo
// oracle_test.jsconstoracledb=require('oracledb');asyncfunctionrun(){letconnection;try{letsql,binds,options,result;connection=awaitoracledb.getConnection({connectString: 'remote_ip/sid_name',user: 'xxx',password: 'yyy',});//// Query the data//sql=`SELECT * FROM USR_ANOTHER.TABLE1`;binds={};// For a complete list of options see the documentation.options={outFormat: oracledb.OUT_FORMAT_OBJECT,// query result format// extendedMetaData: true, // get extra metadata// prefetchRows: 100, // internal buffer allocation size for tuning// fetchArraySize: 100 // internal buffer allocation size for tuning};result=awaitconnection.execute(sql,binds,options);console.log('Metadata: ');console.dir(result.metaData,{depth: null});console.log('Query results: ');console.dir(result.rows,{depth: null});//// Show the date. The value of ORA_SDTZ affects the output//sql=`SELECT TO_CHAR(CURRENT_DATE, 'DD-Mon-YYYY HH24:MI') AS CD FROM DUAL`;result=awaitconnection.execute(sql,binds,options);console.log('Current date query results: ');console.log(result.rows[0]['CD']);}catch(err){console.error(err);}finally{if(connection){try{awaitconnection.close();}catch(err){console.error(err);}}}}run();
// index.tsimport"reflect-metadata";import{createConnection}from"typeorm";import{TABLE1}from"./entity/TABLE1";createConnection().then(asyncconnection=>{console.log("Loading table1 from the database...");constdata=awaitTABLE1.find();console.log("Loaded data: ",data);console.log("Here you can setup and run express/koa/any other framework.");}).catch(error=>console.log(error));
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have a remote oracle database, first I run
npx typeorm-model-generator
and filled some database configurations. And at last I got the following errors.I checked the
.tomg-config
file and the connection part is something like the following.Notes
remote_ip
,sid_name
,xxx
,yyy
is some placeholder.Because the tables I want to generate models is located in another user's tablespace. I tried to modify
schemaName
to something likeUSR_ANOTHER.TABLE1,USR_ANOTHER.TABLE2
. but it's the same error.I also tried a write a plain demo and typeorm demo. They all works.
The only important notes is the table name should prefixed with
USR_ANOTHER
.demo code
plain oracledb demo
typeorm demo
// ormconfig.json
The text was updated successfully, but these errors were encountered: