1. F H
  2. Valentina Database ADK
  3. Wednesday, October 14 2020, 01:54 PM
  4.  Subscribe via email
I'm devolping a mall tool in python which uses several sqlitedatabases for storing the data. At the moment the tool ist importing regular during the night data into the database, so that I can use the data during the day. The Problem is, that my data is always round about 12 hours behind live which now is getting sometime a problem. Thats why I want to migrate my data to sqlite db server. First of all I installed the vserver on my kali linux desktop pc and stored the databases on a Synology NAS and mounted the folder. That works perfect.

Now my questions. Is it possible to access the database direct from my python source code. I installed the Python ADK from Valentina and tried to explore the given examples, but on my both systems I get different errormessages (like you can see in the attached screenshots). I tried a first test with the followig lines wich are based on the examples of VPython.


# Location of the extension (if need)
import sys

# Import extension
import valentina

# Init valentina engine (don't need for client/server)
# valentina.init('VPTN-M-*', 'VPTN-W-*', 'VPTN-L-*')


# Remote server without database
#conn = valentina.connect('sa:sa@')
conn = valentina.connect('sa:sa@')

# Execute query
cursor = conn.cursor()
cursor.execute('SELECT count(*) FROM "block"')

# check some cursor properties:
print( "selected records count is:", cursor.rowcount )

for row in cursor:
print("Anzahl: " + str(row[0]))

except Exception as e:
print("Error-Msg. System: "+str(e))

Can somebody help me with this Problem? What I'm doing wrong?

Thanks a lot

Attachments (3)
There are no comments made yet.
Ruslan Zasukhin Accepted Answer

1) Valentina SQLite Server was not added yet to VPython. On TODO.

2) Can you specify version of your Kali Linux?
There are no comments made yet.
F H Accepted Answer
Is there another was to access the Sqlite Server via Python3?

My Kali Linux is Debian 5.4.19 from 17.02.2020 (Release 2020.1)
There are no comments made yet.
Sergey Pashkov Accepted Answer
Yes, there is also the REST interface.
Switch between Valentina/SQLite databases is done using the "vendor" property.
  1. http://valentina-db.com/docs/dokuwiki/v10/doku.php?id=valentina:articles:vserver_rest
There are no comments made yet.
F H Accepted Answer
I already try to use the REST-AP but I always get the message, that username and password are not correct.

For my tests I converted the Examples from the Wiki into Python3. I attached my example, which doesn't work.

I already try to use the default user sa with the password sa, but this doesn't work. :(
Attachments (1)
There are no comments made yet.
F H Accepted Answer
Hello Sergey,

I found the reason for the authentication problem.

Attached I have a working Python3-Rest-API-Connection, maybe somebody need it.
Attachments (1)
There are no comments made yet.
  • Page :
  • 1

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


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