Search code examples
sqlitevue.jsnativescriptmobile-application

Attempting to load data from existing database using Vue and Sqlite in mobile app


I'm kinda pressing for time. This is my first Nativescript Vue project. Vue is my first since I understand that it performs better than Angular. I was trying to research on loading populated database but I see couple of example using Angular. (I've never used Angular) There isn't much example of Sqlite using populated database using Vue. So I came across https://www.nativescript.org/blog/data-management-with-sqlite-and-vuex-in-a-nativescript-vue-app and tried to adapt to my project.

I am trying to load faaID and airportName from airportTable by using Sqlite. Two things, 1) how do I get this TabViewItem to immediately call load function once that specific tab is clicked and 2) how do I load all of the data from that database and put it into a list (right now I'm testing using Label)...my goal is put it in the listview as an option for the user to select. my database pilotvoice.db is in ./app

You can see my project at https://github.com/stahlie/first-ns-app


Solution

  • Apparently, according to https://github.com/NathanaelA/nativescript-sqlite/blob/master/src/README.md

    I resolved it by adding {from: "**/*.db"} to webpack.config.js