I've had this recurring issue in developing an app based on LiveCloud -- every now and again, without any clear triggers, the SDK becomes 'unusable'. I'm guessing there is a possible corruption issue?
I just get the message 'the CanelaDB SDK is missing' -- when it's clearly there and has been in use for weeks with no issues...
The SDK folder is stored in a folder containing the LiveCode mainstack; it uses a local DB that syncs with the cloud DB with a custom handler called SyncDB pSource, where the pSource is either local or cloud and will overwrite destination at cloud or local respectively...
This type of issue seems to crop up every 3-4 weeks, I'm unable to explain why... If i download the SDK again, it works but of course my concern is if this will keep happening with the deployed app...
ran into problems importing a CSV file into LiveCloud. This is a large file (122 Mb) with 127K + records
Issues:
1. only 103,000 of the 127,000 records were imported
2. the text was exported from an SQL query system that encloses text components in double quotes; there are leading or trailing double quotes (or both) in all fields. However it seems random if these are leading, trailing or both...
3. several fields also have a leading comma in their text (ie. the field starts with ,"field text"
Any advice? (i mean other than programmatically importing the data file to LiveCode and writing a handler to do this)
Just a quick question about BatchSync - I am using cdb_batchSync to update the cloud database from the local database at certain intervals...
It certainly does the job, BUT... it seems to be a 'blocking' command, meaning that everything in the app stalls until the command completes.
Is there a 'non-blocking' version of this, or am i doing this wrong?
this is my algorithm for syncing the entire db in either direction:
command syncDB pSource local tTableNames, tTableID, tInputA, tMessage put cdb_tableNames() into tTableNames repeatforeachline tTable in tTableNames put cdb_tableID(tTable) into tTableID put"*"into tInputA[tTableID]["cdbRecordID"] put pSource into tInputA[tTableID]["source"] puttrueinto tInputA[tTableID]["allowDeletes"] putfalseinto tInputA[tTableID]["detectCollisions"] endrepeat get cdb_batchSync(tInputA)
if cdb_result() isnottruethen put"Error syncing cloud <-> local database: " & cdb_result("response") into tMessage answer tMessage endif end syncDB
I think it may just be a bit too complex to try and maintain a system that flags changes and only syncs them, not in the least as the data is relational involving multiple tables and is still being developed, so i would prefer a system that would just sync everything 'in the background' if that were possible...
As it stands, the process to sync does not appear asynchronous and blocks the interface - grateful for any advice/tips (or if appropriate a feature request for an asynchronous sync!)
Hi all,
I'm having difficulty with getting a standalone to use LiveCloud...
i've adapted the login set up from the 'create project' from LCM's toolkit dialog. I use the same interface/code and if successful login it navigates to another card.
Inside LiveCode (Indy 9.6.1) this works great.
However when building standalone this just doesn't work and no error is generated.
I've made sure all external files for the app and livecloud's required libraries are included.
In particular: Internet, tsNet, mergJSON, SSL & Encryption, as well as the app's CanelaDB toolkit folder are definitely included (I've also tried just adding the 3 subfolders of the /CanelaDB/ folder instead, but no difference)
I've added some debug code to try and figure out where the app fails in the standalone.
Running the 'login' command below gets as far as calling cdb_auth, then nothing else happens in standalone, whereas in LiveCode it works as expected, completing the authorisation and navigating to the correct card. If i try to create a new account, nothing happens again.
The login code called by clicking 'log in' is (comments indicate what works inside LC and in Standalone)
Code:
command login
local tInputA, tLayer, tAuthStatusA, temp
if not _verifyLoginData() then
exit login
end if
answer "about to send cdb_auth" //debug code -- this works in LC and Standalone
get cdb_auth(fld "Email-input" of grp "login",fld "Password-input" of grp "login","User")
put cdb_authStatus() into tAuthStatusA
answer "Response: " & cdb_result("response") //debug code -- does nothing in standalone; no response, no error. In LC this answers authorisation completed
repeat for each key tKey in tAuthStatusA //debug code -- no response here either. In LC it answers cloud: true, local: true
put tKey & ":" && tAuthStatusA[tKey] & return after temp
end repeat
answer temp
if tAuthStatusA["cloud"] then
go to card "card1" //works in LiveCode, but not standalone
else if tAuthStatusA["local"] then
go to card "card2" //works in LiveCode, but not standalone
else
answer "Error authenticating user:" && cdb_result("response")
end if
end login
Based on this it seems like after cdb_auth, the process stalls somewhere in the standalone, as the next 'answer' debug line never fires but does inside LC.
Looking at my firewall, the app doesn't seem to be attempting to connect to the internet at all (according to Little Snitch)
What am I missing? Any help would be greatly appreciated...
Just been looking through the API and came across batchMerge.
While this may be potentially quite useful, I found the documentation fairly impenetrable and difficult to ‘grok’.
Does anyone have a high level overview of this and when it’s used?
Hi all,
I’m trying to convert an existing project from a relational database.
I’m hoping I can get some help constructing a query that’s fairly straightforward in SQL...
In this scenario there are 3 tables:
- table 1 has a list of dates
- table 2 has encounter data that includes a foreign key for person and links to table 1 by date (table1.date = table2.date)
- table 3 has person data and links to table 2 with personID (table2.personID = table3.personID)
So basically selecting a date in from table 1 should retrieve all encounters in table 2 with the same date and in each retrieved result, the personID foreign key should retrieve person data from table 3 when presenting the data.
in SQL i’d just use a SELECT with JOIN statements to retrieve this in one go.
Is this feasible with liveCloud? Or would i need to construct an array running 2 separate queries?
Alternatively, should the data structure change to include all person data in the encounter table for example?
My customer considerations using LiveCloud is the limited RestApi so it will be difficult to connect some of the services we have built.
I hope this can be a feature.