-
Notifications
You must be signed in to change notification settings - Fork 2
Python example
Here is a complete Python program that inserts ['A','BB']
into space[0]
via the high-level Python API. To prepare, paste the code into a file named example.py
, and install tarantool-python
:
$ pip install tarantool
Before trying to run, check that the server (tarantool_box) is running on localhost (127.0.0.1) and its primary port is the default (33013) and space[0]'s primary key type is string (space[0].index[0].key_field[0].type = "STR" in configuration file).
To run, say python example.py. The program will connect to the server, send the request and won't throw exception if all went well. If the row already exists, the program will throw DatabaseException(“Duplicate key exists in unique index 0”).
#!/usr/bin/python
from tarantool import Connection
c = Connection("127.0.0.1", 33013)
result = c.insert(0, 'A','BB')
print result
The example program only shows one command and does not show all that's necessary for good practice.
For future information, please, read Documentation
Architecture
- Server architecture
- R tree index quick start and usage
- LuaJIT
- Vinyl
- SQL
- Testing
- Performance
How To ...?
- ... add new fuzzers
- ... build RPM or Deb package using packpack
- ... calculate memory size
- ... debug core dump of stripped tarantool
- ... debug core from different OS
- ... generate new bootstrap snapshot
- ... use Address Sanitizer
- ... collect a coredump
- ... generate luacov report for builtin module
- ... verify modified lua files via luacheck
Useful links