I have a question regarding core data.
I have a database into my app, and, I'd like to check if the remote database (via ftp) is a new version, for that, I've created a Date field that's allow me to check local date and remote date in order to check if I need to download the database.
Honestly, I don't know of to check this. I'm able to download the remote database into a NSData, but, I don't know how to check a field value into this NSData.
Do you have any idea ? Maybe instead of NSData I can download it into a MutableArray ?
Thanks in advance
Related
I'm confused how to explain myself well here is my scenario.
I have a database named "database1" and i have used typed dataset in visual studio and have added more than 200 stored procedures in the table adapters.
it is a desktop based application. now i want to deployee the same software in other school same database but i have changed the database name
when i generate new database from query and write all the stored procedures in the database and change the database name in the connection string it doesn't work.
I'd recommend you don't change the database name, or if it's something specific to the first client (like ParisTechnicalCollegeDatabase), change it now to something generic (SchoolManager) so you never have to change it again. There's no specific problem I can think of regards reusing a typed dataSet on a different database: I do it daily on database that aren't clones of each other. Ensure your second server is set up with a user and default schema that is specified in the connection string. The problem will eithe per be faulty connection string or incorrect database setup, not the fault of the dataSet
For more targeted help, post up the error messages that appear when you try to run your app on the new database
I have created a small application in loopback in which i was saving user email and password , password in the form of simple text.
Now we have got feature request , to save password in some encrypted format , say , Base64.
So what i want is whenever new user created save password in encrypted format , which is easy , which we can do it.
But issues comes we have created users from many different different code locations, so instead of updating code every place is it possible to add some form of trigger on password field , so whenever this field gets updated , will call a function , which will take password text , and update the same with encrypted format.
so we don't have to worry about writing code everyplace.
Let me know if the question is not clear.
I am looking for Loopback solution.
Thanks
Ever heard of loopback Operation hooks?
https://loopback.io/doc/en/lb2/Operation-hooks.html
use the before save hook or after save hook on a model to do what ever you want.
they have an example, you can try it out
If you use default user model, password is by default stored in encrypted form.
If you want custom trigger than you can do it using remote or operation hooks.
Operation Hook: https://loopback.io/doc/en/lb2/Operation-hooks.html
Remote Hook: https://loopback.io/doc/en/lb2/Remote-hooks.html
The password is stored in encrypted form. You can use operation hook.
Answering your question in the spirit and then in the letter .
Triggers are database level feature where as loop back is your server framework .Keeping that mind your best opportunity within loopback is to use Operation hooks like earlier answers suggested .
However ,if you insist on trigger then you need to use the drivers supported by the DB. In case of oracle there are nodejs-oracle and loopback-oracle connector .If you are using mongo ,which i assume you do , then you may use mongodb oplog which will give you life cycle method where you can hook your desired code .For performance reasons i wouldn't recommend such trigger solutions .
It is not clear from your question what different different code locations means .I assume it is diff parts of your application which might not be loopback .In which case ,putting an entry in a queue and handle it via a processor will be your best bet sothat you can solve the problem of multiple origin .
Our mobile client app uses IMobileServiceSyncTable for data storage and handling syncing between the client and the server.
A behavior we've seen is that, by default, you can't retrieve the entry added to the table when the client is offline. Only when the client table is synced with the server (we do an explicit PushAsync then a PullAsync) can the said entries be retrieved.
Anyone knows of a way to change this behavior so that the mobile client can retrieve the entries added while offline?
Our current solution:
Check if the new entry was pushed to the server
If not, save the entry to a separate local table
When showing the list for the table, we pull from both tables: sync table and regular local table.
Compare the entries from the regular local table to the entries from the sync table for duplicates.
Remove duplicates
Join the lists, order, and show to the user.
Thanks!
This should definitely not be happening (and it isn't in my simple tests). I suspect there is a problem with the Id field - perhaps you are generating it and there are conflicts?
If you can open a GitHub Issue on https://github.com/azure/azure-mobile-apps-net-client/issues and share some of your code (via a test repository), we can perhaps debug further.
One idea - rather than let the server generate an Id, generate an Id using Guid.NewGuid().ToString(). The server will then accept this as a new Id.
I need to process files in an order based on the file modify/create date. I'm using a logic app to process files but cannot get to the date property using the List or the Get from the SFTP Connector or the FTP connector.
Any thoughts on how this can be accomplished?
Any access to source code so I can make a tweak or two?
The current SFTP and FTP do not return modified date/time. If you could choose one of the following, do you have a preference? Not making any promises but investigating best way to resolve this and light up this scenario:
Add FileModifiedDateTime property for each file returned
Provide a parameter to sort the ListFiles. So, property is still not exposed, but the files are sorted as required by the client so you don't have to check the time of each file to see which is earliest.
I am working on a small project and I can upload data to a mongo database but so far I have been unable to save an image to the same database, a friend of mine advised me to send a reference to the database but at this stage I have not worked out how to do this, any assistance would be greatly appreciated.
You can use node-s3-uploader library from Turistforeningen or build something like that if you want to save on local disk. The work behind is get the image file which you received, transform it to multiple versions to optimize bandwidth, you keep a reference to original version on MongoDB or MySQL.
When client request an image, send them the original link, depend on which case they need, client will deduce original link to re-scale link.
Assets like image should not be saved to database system directly but to local disk of your server, and you just save the link of that image to the database.
The database system like mongodb or mysql should save things that will be queried, and that's why we use database system. Things like binary file or image should just save to the local disk, because the content of these file is unreadable, and also can not be queried. But the name, path or URL of these file can be queried, so we normally save these things to database system.