1. Alexis Colon Lugo
  2. as SQLite DB Server
  3. Среда, Май 01 2019, 11:57 AM
  4.  Подписаться через email
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
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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.
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
ok
can you send me example link for how this can works using rest api

thanks
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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.
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
hi
if i use XOJO for ios can do rest api with valentina db
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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)
Вложения
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
Hi
how i install the rest server in my Raspberry PI to connect from XOJO iOS App
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
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
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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.
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
ok
where is locate the folder for lic in the linux
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Here:
/opt/VServer/licenses
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
thanks Sergey

how i now lic is working after copy file lic

thanks
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
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 )
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
Not yet i understand change dict.Value( "vendor" ) = inSQLVendor for valentina. what do you meen.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello,

Pass "Valentina" as a value for inSQLVendor parameter.

It's a switch between two types of databases.
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
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
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello Alexis,

Please add more details.
Did you implement Error method in your connection socket, like on screenshot?
Вложения
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
yes
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
i have error num -1004
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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?
Комментарий
There are no comments made yet.
  • Страница :
  • 1
  • 2
  • 3


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