Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to input config when initializing sql.js #4559

Closed
DavidChen-minted opened this issue Aug 8, 2019 · 1 comment · Fixed by #4560
Closed

Add options to input config when initializing sql.js #4559

DavidChen-minted opened this issue Aug 8, 2019 · 1 comment · Fixed by #4560

Comments

@DavidChen-minted
Copy link
Contributor

Issue type:

[ ] question
[ ] bug report
[x] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[x] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Typeorm added supports for Sql.js v1.0 #4104 but it needs a new connection option to pass in initConfigs, such as { locateFile: filename => ``/dist/${filename}`` }.

@exequielc
Copy link

Hi, I'm using this old sql.js v0.5.0 and don't understand how to change the conection in order to upgrade to 1.0

I'm using the Ionic implementation.

let dbOptions: ConnectionOptions;
 dbOptions = {
          type: 'sqljs',
          location: 'browser',
          autoSave: true
 };
 Object.assign(dbOptions, {
      synchronize: true,
      autoSchemaSync: true,
      migrationsRun: true,
      entities: [    tables   ]
    });
     return createConnection(dbOptions).then(connection => {
      console.log("Data Access connected!");
      return connection;
    }).catch(error => {
      //console.log("Data Access Error : ", );
      return null;
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants