Commit Graph

69 Commits

Author SHA1 Message Date
Michael Cahill
2fb179afbd Decide statically what error handling is required. 2012-07-10 11:12:53 +10:00
Keith Bostic
80c1c05662 Change SWIG mapping to treat cursor.equals as a boolean return.
Change SWIG mapping to only support WT_NOTFOUND return from cursor methods
that search for keys.
2012-07-09 14:05:26 +00:00
Michael Cahill
8e0bafa05e Add a cast to the Python API when setting a record number.
(Found in transaction testing, refs #183).
2012-05-23 21:45:14 +10:00
Michael Cahill
410e800b1e retab the SWIG input file: whitespace was inconsistent. 2012-05-14 10:22:33 +10:00
Michael Cahill
8f941fa757 Handle errors in Python cursor._set_recno. 2012-05-14 10:02:36 +10:00
Keith Bostic
ff12749de3 The wiredtiger_struct_size() call can fail, it has to return an error
status, not a size.
2012-05-11 10:56:09 +00:00
Keith Bostic
5a06143447 Change wiredtiger_struct_{size,pack,unpack} to take a WT_SESSION as their
first argument, they're calling underlying functions that need to handle
errors in appropriate ways.

Fix some related documentation problems.

__log_record_size was calling the wrong function, fix that while I'm in
the area.

ref #209.
2012-05-11 10:36:20 +00:00
Michael Cahill
362714a228 Move the python "check" into lang/python: that simplifies things and avoids tracking the dependency. 2012-05-04 10:39:46 +10:00
Michael Cahill
4e7a2cd095 Add an interface for "data source" extensions.
--HG--
rename : docs/src/cursors.dox => docs/src/data_sources.dox
2012-03-11 10:46:07 +11:00
Keith Bostic
4b77de7959 Update copyright notice. 2012-03-12 12:09:20 -04:00
Keith Bostic
003688a168 SWIG 2.0.4 no longer mentions a LICENSE file, so there's reason we need to
have one, as far as I can tell.
2012-02-06 19:47:17 +00:00
Keith Bostic
8347925459 Retain copyright on the Python API, add the SWIG license to the local
directory.
2012-02-02 20:18:52 +00:00
Keith Bostic
8345e010cf The Python code is in the public domain. 2012-02-02 11:25:36 +00:00
Michael Cahill
734f5a7974 Update copyright notices for the BDB stubs and the Python API tests.
--HG--
extra : rebase_source : c270e923e1df304e8190062413a5028ad3da78d4
2012-02-02 10:03:18 +11:00
Keith Bostic
ce8d2c2558 Update the copyright notices. 2012-02-01 19:09:17 +00:00
Keith Bostic
4879e63e5b More copyright cleanup. 2012-02-01 15:32:36 +00:00
Michael Cahill
3fa04a7148 Add WT_CURSOR::uri containing the cursor source URI, primarily in support of WT_CURSOR::equals.
closes #153
2012-01-31 00:50:04 +11:00
Michael Cahill
246589707a Replace WT_CURSOR::first,last} with WT_CURSOR::reset. 2012-01-25 14:24:15 +11:00
Don Anderson
d5af0d22b0 Use new stat defines to look up values by key, rather than matching strings. 2012-01-24 11:39:54 +11:00
Michael Cahill
18d4ae91c3 Use underscores in public struct names to avoid namespace pollution. 2012-01-18 11:55:01 +11:00
Michael Cahill
86c3f25313 Add documentation to the Python API. 2011-11-02 10:34:30 +11:00
Don Anderson
d182472964 Added a test for 'wt dump'. Fixed python interface so that
wiredtiger_version() returns all its int values.
refs #16

--HG--
extra : rebase_source : 04afdc038a7201bb30cbc6bc384dcc3300533f46
2011-10-22 11:26:33 -04:00
Don Anderson
4fe07a6658 Fix output arg for search_near in python API. refs #31
Added more tests for cursor.search() and cursor.search_near().  refs #16

--HG--
extra : rebase_source : 5a6ec0aac1d61ae475e9ef355f6a051cf72ce6d5
2011-10-09 15:59:35 -04:00
Don Anderson
fd85797033 Added support to pack type 't', needed for 'fix' tables.
Added a simple test for fix tables.
refs #31
refs #16

--HG--
extra : rebase_source : 26f08d2b3715df318a0965e9c0d0f8b437cd8240
2011-10-06 07:06:08 -04:00
Michael Cahill
a5b0fd47de Don't require SWIG to build the Python API from a release. 2011-09-16 16:38:39 +10:00
Michael Cahill
dd5bee8486 Handle record numbers in raw cursors. 2011-09-15 21:41:17 +10:00
Michael Cahill
0c9c1d263b Some minor test fixes. 2011-09-15 15:13:05 +10:00
Don Anderson
4e36b6987d Added some workarounds to allow recnos to start to work:
- disable WT_CURSTD_RAW cursor flag for the duration of the call to get/set_key
- added typemaps so that Python long are compatible with 64 bit int
refs #31

--HG--
extra : rebase_source : bb25c23fcd649330e5729fe78d846ef81afb7a09
2011-09-14 16:30:25 -04:00
Michael Cahill
27a1bd8606 Use the swig "-thread" command line flag, it wraps our extension functions correctly as well. 2011-09-08 18:26:44 +10:00
Don Anderson
e7bdd917b0 Use an adaptor class for iterable, so we don't have to rename 'wt_cursor.next'.
refs #31

--HG--
extra : rebase_source : 0dcc43912afc6a15566f18551faf64c6369fabb9
2011-09-06 06:44:21 -04:00
Michael Cahill
b12f6c5458 Fix up various build issues:
* make test programs link statically by default
* depende on libwiredtiger.la so tests are relinked when the library changes
* don't bother with helper targets for test/insert
2011-09-06 07:09:39 +10:00
Michael Cahill
c545f4fc29 Split out the Python and examples from the top level Makefile. 2011-09-02 21:53:51 +10:00
Michael Cahill
9018517cb6 Add a cursor.reset operation to the Python API so that tests can use a cursor for inserts, then loop through the whole table in a natural way. 2011-09-02 21:53:51 +10:00
Michael Cahill
45c9f74209 Add some missing error checking to extension functions in the Python API. 2011-08-29 15:46:55 +10:00
Michael Cahill
574d7b43cf Add libtool to the build.
While in the area, add a pkg-config file.
* * *
[mq]: build-fixes
2011-08-26 15:28:43 +10:00
Don Anderson
5806941282 Release the Global Interpreter Lock during all WT calls.
Otherwise there will be no real multithreading for WT.
refs #31

--HG--
extra : rebase_source : 3c162bf4e42d21aebe4a3421d5d90feb2ae48ef4
2011-08-19 09:44:07 -04:00
Michael Cahill
d1ac7e8e57 Replace wiredtiger_recno_t with uint64_t.
closes #71
2011-07-22 09:40:58 +10:00
Michael Cahill
fdf68e5060 Update Python proxy objects after calling "close" methods to discard their pointers. This avoids common cases that can lead to segfaults.
Note that this isn't a complete solution: bad Python code can still reference a
freed pointer (e.g., by using a cursor after closing the session that was used
to allocate the cursor).  Solving that problem completely would involve
tracking ownership in Python.
2011-07-16 00:12:42 +10:00
Michael Cahill
5138ce4074 Supply default values for "config" parameters in the Python API, remove event
handlers from the interface
2011-07-16 00:08:47 +10:00
Michael Cahill
a2dbd9a5aa Fix several issues in the unit tests and the Python API so that all unit tests now pass:
* if an open_cursor operation fails, don't attempt to modify the cursor
* the cursor iteration code has to stop on WT_NOTFOUND
* some config strings have been renamed (internal_* rather than intl_*)
2011-07-15 09:42:47 +10:00
Michael Cahill
a2af418581 Pass CFLAGS and LDFLAGS into the Python build explicitly in the Makefile. 2011-07-14 16:58:51 +10:00
Michael Cahill
f582b2b532 In the Python build, only set extra_*_args if CFLAGS or LDFLAGS are set. 2011-07-14 16:51:51 +10:00
Michael Cahill
04dc7ec4ab Pass CFLAGS and LDFLAGS through to the Python build. 2011-07-14 16:44:13 +10:00
Michael Cahill
93ab4058e7 Implement full packing and unpacking for multi-column keys/values.
--HG--
rename : lang/python/packing.py => lang/python/fpacking.py
rename : lang/python/intpack-test.py => lang/python/packing-test.py
rename : src/api/pack.c => src/schema/packing.c
rename : test/packing/intpack-test.c => test/packing/packing-test.c
2011-05-26 14:04:46 +10:00
Michael Cahill
b14ab0e44e Tuning and fixes for integer packing, add the Python implementation and test that both produce the same results.
refs #50
2011-05-24 21:32:38 +10:00
Michael Cahill
14b4b467e2 Support multi-column keys and values in the Python API (in future).
refs #1
2011-05-12 09:22:03 +10:00
Don Anderson
92d3d7b641 Add support for wiredtiger exceptions in python.
Added a subtest of test001 that makes sure exceptions are working.
refs #31
2011-04-28 17:05:35 -04:00
Don Anderson
2b9689319f Reworked python iterable to handle arbitrary types and added a test case (test003)
for it, using combinations of string/int.  int currently not implemented by underlying
interface, so only one test works.
refs #31

--HG--
extra : rebase_source : 099ec48ce6b83f749a9f0acd9f01c1986ae2619d
2011-05-09 10:15:25 -04:00
Michael Cahill
c0650abe86 Another fix for relative paths in the Python build: setup.py wants to own the tree. 2011-04-26 17:34:23 +10:00
Michael Cahill
3a6dc4749e Fix Python build again: split SWIG out of setup.py, we want to distribute the
results so SWIG isn't required by users to build the Python API.  This also
addresses some annoyances with paths, since we want to build in a different
place from the Python sources.
2011-04-26 17:24:21 +10:00