import { SQLite } from '@ionic-native/sqlite/ngx'; constructor(private sqlite: SQLite) { } this.sqlite.create({ name: 'mydatabase.db', location: 'default' }).then((db: any) => { // DB instance created }, (error: any) => { // Error occurred });
db.executeSql('SELECT name FROM sqlite_master WHERE type="table"', []).then((data) => { console.log('Tables:', data.rows); }, (error) => { console.error(error); });This code executes a simple SQL query to select all table names in the database, and logs the results to the console. The `@ionic-native/sqlite` package can be found on npmjs.com.