I am writing a chat app in Ionic 2. I want to save some of the the messages locally on the phone.
I am using Firebase as the messaging system. It stores the messages in JSON notation. When I read a message I want to store it locally and delete it from Firebase
Should I use SQLite or Local Storage?
I would normally say SQLite bexcuse it's more reliable, but because Firebase uses JSON, should I rather store the local messages as JSON in Local Storage?
Any advise appreciated.
Because you are using Ionic, I would suggest that you use the ionic-storage module.
By default it uses the most advanced storage mechanism available. So in Chrome, it will use IndexedDB and fall back to WebSQL or LocalStorage.
If you install the cordova-sqlite-storage plugin, ionic-storage will use sqlite as the storage engine when running on the device.
You can only store key-value pairs using ionic-storage, so you can't use custom sql-queries. But storing JSON works without any modifications.
Related
I am importing a complex JSON schema with several APIs declared. Postman has been an essential tool to test these APIs as I develop them, but I am iterating a lot and it is becoming very cumbersome to manually delete every API, which requires the typing in of every API name.
Short of a new feature (say "reimport JSON schema folder"), is there a way for me to delete a file to reset my Postman back to its original installed state? I'm on MacOS. I have tried deleting a few folders I thought would do the trick, but they keep getting recreated with my former APIs intact.
I have installed google datastore emulator in my local machine along with it written a sample spring boot application which performs crud operations on datastore.
When i hit the rest endpoints through postman i can actually see the data gets inserted in datastore in gcp console
can someone help me by clearing below queries:
1>Even though using an emulator in local , whether data gets inserted to actual datastore in cloud (gcp)
2>what is the purpose of emulator (if qn 1 is correct)
No data is inserted on Datastore servers, everything is local as mentioned here
The emulator simulates Datastore by creating /WEB-INF/appengine-generated/local_db.bin in a specified data directory and storing data in local_db.bin. By default, the emulator uses the data directory ~/.config/gcloud/emulators/datastore/. The local_db.bin file persists between sessions of the emulator. You can set up multiple data directories and think of each as a separate, local Datastore mode instance. To clear the contents of a local_db.bin file, stop the emulator and manually delete the file.
There are multiple uses for example:
To develop and test your application locally without writing actual Data to the servers hence avoiding charges during the development process
Help you generate indexes for your production Firestore in Datastore mode instance and delete unneeded indexes, that could be exported then into production
Edit
In order to use the emulator on the same machine it's recommended to set the environment variables automatically as mentioned in the documentation
I look for a way to access to data which are stored on a SAS/IntrNet database using Python. I don't find any information on the way to achieve it!
Currently, I access to data using a web viewer on a adress like :
http://remote.server/cgi-bin/broker.dll?_service=prod_sas9_ux&_program=prog.include.sas.
Is someone know a solution to access to the data using a python script ?
Try the python requests (http://docs.python-requests.org/en/master/) library. This will allow you to call the SAS service via HTTP.
You will have to parse the results to build your python data structure
I am used to Google Cloud SQL, where you can connect to a database outside of GAE. Is something like this possible for the GAE datastore, using the Python NDB interface ideally ?
Basically, my use-case is I want to run acceptance tests that pre-populate and clean a datastore.
It looks like the current options are a JSON API or protocol buffers -- in beta. If so, it's kind of a pain then I can't use my NDB models to populate the data, but have to reimplement them for the tests, and worry that they haven't been saved to the datastore in the exact same way as if through the application.
Just checking I'm not missing something....
PS. yes I know about remote_api_shell, I don't want a shell though. I guess piping commands into it is one way, but ugghh ...
Cloud Datastore can be accessed via client libraries outside of App Engine. They run on the "v1 API" which just went GA (August 16, 2016) after a few years in Beta.
The Client Libraries are available for Python, Java, Go, Node.js, Ruby, and there is even .NET.
As a note, GQL language variant supported in DB/NDB is a bit different from what the Cloud Datastore service itself supports via the v1 API. The NDB Client Library does some of its own custom parsing that can split certain queries into multiple ones to send to the service, combining the results client-side.
Take a read of our GQL reference docs.
Short answer: they're working on it. Details in
google-cloud-datastore#2 and gcloud-python#40.
I have a requirement to build a flex mobile app (iOS/Android) which is capable of downloading data from the web (product animations and associated data).
It needs to handle additional product lines if I add any and cache the data offline (in SQlite I guess).
I think web services is probably the answer but is it possible to load an external library such as SWF or SWC using this method?
Any help is much appreciated as always!
I think web services is probably the answer but is it possible to load
an external library such as SWF or SWC using this method?
If you need to pass data to and from a Flex app then you can use RemoteObject (AMF), WebService (SOAP), or HTTPService (REST). My personal recommendation is to use RemoteObject/AMF whenever possible.
You can load another SWF at runtime using SWFLoader. I'm pretty sure that SWFLoader will not work on iOS as there are clauses in the iOS Developer agreement that you can have code that will interpret other code at runtime or something similar.