1. Alexis Colon Lugo
  2. as SQLite DB Server
  3. Mittwoch, Mai 01 2019, 11:57 AM
  4.  Abonnieren via E-Mail
Hi
i need to made one app for iPad but i need to sync with my local mini server with valentina sqlite server.

can this works or no

thanks
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello Alexis,

No automatic way to do such synchronisation.
Also, iV4CC (Objective-C/Swift iOS client) doesn't have SQLite support yet, we'll add it, of course, but currently only the REST API can be used.
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
ok
can you send me example link for how this can works using rest api

thanks
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
There are no examples for Swift.
A lot of generic examples of HTTP requests, the easiest I think is to use NSURLConnection.sendSynchronousRequest:
https://stackoverflow.com/questions/24016142/how-to-make-an-http-request-in-swift

Generic examples in Python:
http://valentina-db.com/docs/dokuwiki/v9/doku.php?id=valentina:articles:vserver_rest

Also, there are Xojo examples, they are all asynchronous.
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
hi
if i use XOJO for ios can do rest api with valentina db
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hi Alexis,

Yes, you can use iOS_vSQLite_Fast example, just replace "SQLite" with "Valentina" in Vendor parameter.

In example, this parameter is passed to DoSQLSocket Start method (on screenshot):
Start( inHost As Text, inSessionID As Text, inSQLURL As Text, inSQLVendor As Text, inSQLDatabase As Text, inQuery As Text)
Anhänge
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
Hi
how i install the rest server in my Raspberry PI to connect from XOJO iOS App
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hi Alexis,

What system do you use?
For Debian-like distribution it is:

wget http://valentina-db.com/download/release/lin_arm_32/vserver_armhf_32_9_lin.deb
sudo dpkg -i vserver_armhf_32_9_lin.deb
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
yes Debian

now is install

How i set user a password for the server and if i can use VStudio from mac to connect to raspberry pi and edit the DB.

thanks
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
The login/password by default is sa/sa, you can change it using the Server Admin in Valentina Studio (make sure to put a Linux license in the licenses folder of VServer - Server Admin uses a separate connection).

Yes, you can connect from macOS and edit DB like on the usual Linux server.
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
ok
where is locate the folder for lic in the linux
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Here:
/opt/VServer/licenses
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
thanks Sergey

how i now lic is working after copy file lic

thanks
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
next question

RequestHeader( "Accept" ) = "application/json"
RequestHeader( "Content-Type" ) = "application/json"
RequestHeader( "Cookie" ) = inSessionID

Dim url As Text = inHost + inSQLURL

// Prepare data
Dim dict As New Dictionary
dict.Value( "vendor" ) = inSQLVendor <<<<<<<< for use sqlite VServer in raspberry pi how i config it. Like ip of pi server, user, password
dict.Value( "database" ) = inSQLDatabase
dict.Value( "query" ) = inQuery

Dim json As Text = Xojo.Data.GenerateJSON(dict)
Dim data As MemoryBlock = Xojo.Core.TextEncoding.UTF8.ConvertTextToData(json)

SetRequestContent(data, "application/json";)

// Send the POST request
Send( "POST", url )
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
Not yet i understand change dict.Value( "vendor" ) = inSQLVendor for valentina. what do you meen.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello,

Pass "Valentina" as a value for inSQLVendor parameter.

It's a switch between two types of databases.
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
Hi
I try and i have msg see error who i now what error number or problem when try to connect to the server

thanks
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello Alexis,

Please add more details.
Did you implement Error method in your connection socket, like on screenshot?
Anhänge
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
yes
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
i have error num -1004
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
In which method do you receive this error number? No Reason or Message texts in exception?
You can also check /opt/VServer/log - does the log have entries about connection?
Kommentar
There are no comments made yet.
  • Seite :
  • 1
  • 2
  • 3


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories