I'm working on a Sencha Touch project and I'm in need to pack the app with a prepopulated DB. I'm using Cordova-SQLitePlugin (https://github.com/brodysoft/Cordova-SQLitePlugin) as a cordova plugin to use SQLite as a local DB and I've been looking around for ways of achieving my goal of prepopulating the DB but with no success. What I've found are blogs suggesting to copy the DB in a cordova folder and it's supposed to magically work but I haven't had any luck and I'm guessing it has something to do with my project being a Sencha Touch + Cordova project.
What I've done so far is run all the queries on the app's first launch and populate the app there, but the things is I have like 50k inserts to do so it really makes the code awful and I could spare the user the time it takes to do those inserts by packing the app with the DB ready to use.
Does anyone know a way around this?
Ok! Did it!
I got some help from a guy at Sencha forums and he pointed me to a repo he posted on github with an example of Antair's SQLite plugin for Cordova.
Here's the link to the repo in case anyone needs it: https://github.com/Yoinbol/SqlitePopulated
The DB is placed at cordova/www/db/ folder (db folder must be created).
There's a file named importdb.js at cordova/www/resources/scripts/ that listens to deviceready and loads the db when it fires. (I had to change importIfExists from false to true in here to make it work)
In the Main.js controller there's an example of how to open the DB in case anyone needs that too.
Anyway, hope this helps anyone in need sometime and thanks to Diego Garcia at Sencha forums for the help.
Related
Hello my dear developers. Help me plz with that question.
I have Laravel api application and nuxt 3 as a frontend application.
With Laravel i had no problems with deploing but with nuxt...
So as documention says i need to run nxp nuxi generate command. But its creates fully static site, and its working but api calls not really works.
I want to deploy on my server that has linux and other required thinks also installed (..etc node)
I want to deploy it via ftp. That some pages are static but some pages are requests data from api when we update the page.
How can i do it plz.
I tryed npx nuxi generate.Also with ssr false in nuxt config file.
I tryed npm run build. But its says just error.
Thank you for reviewing my question and comments to it.
So i used npx nuxi generate and also i putted ssr false in nuxtconfig
The i pushed .output/public to my server via ftp.
And everything works great.
In future i want to add some pages in nuxtconfig to preload them. So they will be fully static. Hope i can do it. (i`m still learning...)
The problem that confused me, is that when i did it first time, its loaded with fetched data, and when i tryed to change data. I could see any errors. And when i made my database fully emty it still showed data. But when i tryed to do it now, it works. I dont really understood why. Hope maybe it will help someone. Becouse its not really enought info in interner. Or im just a bad googler xD
Peace to everyone
Since you seem quite new, I recommend that you stick to:
vanilla Vue3 app
hosting on Netlify
When you'll be more comfortable with those, then you could proceed hosting a Nuxt3 app on your own VPS.
I learned the hard way that plugins can and will disappear if I add them via the UI. According to the help: "Bluemix, like other cloud platforms, has an ephemeral filesystem. Every time you push or restart your app, the container that stores the files for your app is destroyed and recreated. If you update the WordPress Core from the UI, then the update is rolled back when your app is restarted."
So I'm now trying to add them via the Cloud Foundry command line interface as suggested in the help docs.
I downloaded the application starter code, extracted it to a New_folder, downloaded the plugin I wanted, extracted that to the New_folder/wp-content/plugins/ and then tried to do a cf push. I got no errors but the plugin is not showing up in the wp-admin page.
Total Wordpress newbie here... Can anyone provide me any clues on what I'm doing wrong or steps I'm missing? Has anyone else tried this?
Ok got it working. I figured it out with help from the Bluemix dev team, here is what they said:
We are still waiting for our updated documentation to land. We should have synchronized the updated deployment with the corresponding documentation updates, sorry for the trouble.
Until the docs at https://www.ng.bluemix.net/docs/#starters/wordpress/index.html#wordpress are updated, please follow the steps posted at https://developer.ibm.com/answers/questions/181148/wordpress-changed-wordpress-file-not-uploaded/#answer-181784 and report back if you have any trouble.
In my jQuery Mobile App i have created sQlite Database and all transactions work successfully , and I want to see the DB file, I searched for it in my project directory but I didn't found it? Does phonegap create file for the created sqlite DB? and where is it? how I can pull the DB file in order to see the inserted data?
I have searched over the internet but I didn't found any answer ,please help me .. since I am new in jQuery Mobile.
Thanks in advance.
Most likely your database is being created in android's cache directory. The following stackoverflow followup answer by the original questioner and it's backlink to an earlier answer should be all you need:
Using PhoneGap for Android : Not able to create table in the database
I'm in need of some help in developing a desktop application with a pre-populated database. I have tried numerous ways to get this working including those mentioned on both Tidesdk's API here http://tidesdk.multipart.net/docs/user-dev/generated/#!/api/Ti.Database.DB and at Titanium Desktops old API here http://developer.appcelerator.com/apidoc/desktop/latest/Titanium.Database-module.
While the later (using Titanium not Ti) works in creating a database in the apps directory it does not install my pre-populated sqlite database which is located in the resources file of my app.
A couple of my attempts located below
var db = Titanium.Database.openFile('test_db.sqlite', 'test_db');
var db = Titanium.Database.openFile(Ti.Filesystem.getFile(
Ti.Filesystem.getApplicationDataDirectory(), 'test_db.sqlite'));
var db = Ti.Database.open('test_db');
As stated most of these manage to create a database with the name given but when trying to run something as simple as a db.execute(SELECT) of something I know would exist in my pre-populated db I receive an error stating
Exception executing: SELECT name, id FROM people ORDER BY name COLLATE NOCASE, Error was: SQL Statement invalid or database missing
I have searched high and low for something to answer this but everyone continues to refer to the aforementioned API's or to the Mobile API's Ti.database.install() which does not work either.
Is it possible with titanium desktop to use a pre-populated sqlite database or do I have to populate it after I create it? If so any direction would be helpful (where to place the .sqlite file in the app and what functions to call).
I am currently using Titanium Studio with a titanium desktop osx SDK of 1.2.0.RC4 as requested by tidesdk.org until they have released there open source sdk.
Thanks in advance
This is possible, I just used this feature in a recent desktop app, deployed it successfully to Windows and Mac.
In my experience, sometimes your database file can be corrupted, for example if you use the Titanium.Database.install command, and it cant find the file to preload from (maybe the first time you specified the path wrong for instance), it will create the file itself, any subsequent install commands will not work because it already thinks this database has been installed.
Have you tried clearing out the application data? This is where titanium installs the database. For Mac this is in your /User/Library/Application Support/APPNAME directory. Their is a directory for databases, delete this and try again.
Also, this answer on Titanium Q&A may help, it talks about the process with the Mobile SDK but the Database stuff is the same.
Hope this helps!
I'm working through the "Demo: Binding Data with the SqlDataSource" of this pluralsight video on ASP.NET Webforms.
All communication with the database works just fine, except it won't change when updates are made. The only thing I've done differently from the video is to use Northwind.sdf instead of Northwind.mdf. The database exists in the project directory, which is under my Users directory on win7 -- so it shouldn't be a permissions problem.
What could be preventing it from updating?
In case anyone wants to try the sample app, I uploaded the whole project folder here on mediafire.
Maybe you have two copies of the database. You are updating copy A and then checking copy B.
Or, it could be one of the reasons described here: http://weblogs.asp.net/stevewellens/archive/2009/10/16/why-sql-updates-fail-three-reasons.aspx