sqlite3 - typeorm issue while creating connection in ionic 2 -


when try create connection in ionic orm throws following error:

driver option (storage) not set. please set perform connection database

here code connect in app.ts

createconnection({         driver: {         type: "sqlite",         database: "test"         },         entities: [          products         ],         autoschemasync: true,         }).then(connection => {             alert(connection);                 let product = new products();          }).catch(error => console.log(error)); 

you need specify storage path sqlite database in driver options:

createconnection({     driver: {         type: "sqlite",         storage: "temp/test.db"     },     entities: [         products     ],     autoschemasync: true, }).then(connection => {     alert(connection);     let product = new products(); }).catch(error => console.log(error)); 

see here available options: https://typeorm.github.io/databases-and-drivers.html


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

angular - Copying node modules to wwwroot AspNetCore -