Commit Graph

119 Commits

Author SHA1 Message Date
John Lee
798e92e472 Fix find order_by bug for descending order 2014-03-07 17:07:38 -08:00
Friedrich Lindenberg
6ef4cd7814 Revert to using OrderedDict. 2014-02-18 12:59:12 +01:00
Chen Liu
03cb294e34 fix rows to rows.rowcount 2014-02-04 09:23:49 +01:00
Chen Liu
5b162feea7 add __repr__ method to Table 2014-02-04 09:23:42 +01:00
Chen Liu
682b90cb6e let table.delete return true/false 2014-02-04 09:23:34 +01:00
Stefan Wehrmeyer
5f2c0193b8 Make print a function in documentation 2014-01-31 20:42:26 +01:00
Stefan Wehrmeyer
8f4cd59c9a Treat columns as ordered throughout code
The set() does not make anything any easier,
lists are closer to underlying representation.
2014-01-31 20:42:04 +01:00
Stefan Wehrmeyer
92817d5f4d Make flake8 part of test suite 2014-01-25 21:45:30 +01:00
Stefan Wehrmeyer
0726dd9cf3 Remove OrderedDict implementation as RowProxy is returned
http://docs.sqlalchemy.org/en/rel_0_9/core/connections.html?highlight=rowproxy#sqlalchemy.engine.RowProxy
2014-01-25 21:22:11 +01:00
Stefan Wehrmeyer
eff6925af9 Fix infinite loop in find method
If a _limit is not given, the query limit should
be given by eit
2014-01-25 21:20:18 +01:00
Aditya Upadhyay
6d5e1c755f fixed bug with offsets and limits. 2014-01-12 23:56:14 +05:30
Friedrich Lindenberg
3abe9d2c8d Merge branch 'python-3' of github.com:stefanw/dataset into stefanw-python-3 2014-01-05 17:52:59 +01:00
Friedrich Lindenberg
ec9a2c56d1 Merge commit '2566581442eff9b17ee439296e7c4e9c232cee26' 2014-01-05 16:01:32 +01:00
Abhinav Upadhyay
508e025689 Fix insert for tables that do not have any primary key.
The insert method returns the value of the primary key for the inserted
row. But for tables that do not have any primary key, it raises an
IndexError, which is clearly wrong. At best it should return None in
such cases and avoid raising any exception.
2014-01-04 11:53:15 +05:30
Gregor Aisch
2566581442 using OrderedDict to preserve key order 2013-12-20 00:01:26 +01:00
Stefan Wehrmeyer
2870fdfb0b Fix a couple of more iterator changes 2013-12-18 11:32:58 +01:00
Stefan Wehrmeyer
74b900f1f6 Move from sqlalchemy-migrate to alembic
This affects how columns are added and dropped from
tables. MetaData and SQLATable objects have to be
recreated to make sync changed columns.
2013-12-18 04:08:24 +01:00
Stefan Wehrmeyer
23e484cbed Handle Python 3 keys/values iterators 2013-12-18 04:08:23 +01:00
Stefan Wehrmeyer
88c0c1a15f Remove basestring, unicode from code base 2013-12-18 04:08:21 +01:00
Friedrich Lindenberg
d393523764 use row.copy() not copy.copy(row) 2013-12-05 13:11:04 +01:00
Chen
36b27c354b add drop_column function 2013-12-04 14:44:01 -05:00
Friedrich Lindenberg
a174225de3 Change code to use copy(). 2013-12-04 17:55:42 +01:00
Friedrich Lindenberg
ff247f17cc Create a new dict before updating data. Fixes #53 2013-12-04 11:09:22 +01:00
Friedrich Lindenberg
ea582d3fce Merge pull request #39 from diegoguimaraes/master
Fixing bug
2013-11-15 12:43:56 -08:00
Diego Guimarães
bc16b9e325 Fixing bug
Fixing bug where the insert method always returns 0,
even after a successfully insetion, rather than the id
of the inserted element.
2013-11-14 22:24:44 -02:00
George "elb0w" Tsafas
7675198640 Some refactors I noticed when reading through the code
Pretty nicely written, I didnt actually test these. But I think they are sane. Nice project, im going to use it later.
2013-11-13 09:57:25 -05:00
Friedrich Lindenberg
dc144a27b0 have find_one return a dict, not a tuple 2013-11-04 17:29:20 +01:00
Brian Abelson
1f77509017 update table.update to perform the same as upsert 2013-08-11 10:40:27 -04:00
Brian Abelson
904e464dfa allow keys arg for upsert to be a string
I want to be able to use `upsert` without formatting the keys arg as a list, ie:
```
table.upsert(new_data, "id")
```
2013-08-10 21:34:00 -04:00
Friedrich Lindenberg
f520193a9e Merge pull request #17 from scraperdragon/upsert_all_key
Permit upsert with all columns as keys
2013-06-27 09:39:13 -07:00
David McKee
6533fd16e9 upsert with all keys 2013-06-27 12:12:33 +00:00
scraperdragon
79acee2371 Describe what happens when find_one has nothing to return. 2013-06-27 11:47:04 +01:00
Friedrich Lindenberg
e10dc36219 Try to avoid some locking issues. 2013-06-14 10:33:57 +02:00
Friedrich Lindenberg
10dfcad00b Merge branch 'refs/heads/feature/transactions' 2013-06-13 11:57:23 +02:00
Brett Beaudoin
fffa633e84 Added support for "IN" operator of a WHERE clause.
The table update only allowed for "==" operator as in:
  UPDATE mytable SET foo = 'bar' WHERE id = 123;

Now allows for "IN" operator as in:
  UPDATE mytable SET foo = 'bar' WHERE id IN (123, 876);

This required changes to the "_args_to_clause" and "update" functions.
2013-06-06 17:23:52 -06:00
Friedrich Lindenberg
db71b6d631 Re-write locking to support transactions. 2013-05-13 21:21:25 +02:00
Friedrich Lindenberg
33908b2699 Use engine for DDL 2013-05-13 20:14:57 +02:00
Friedrich Lindenberg
b5181a4105 Testing with transactions support. 2013-05-10 22:58:23 +02:00
Gregor Aisch
bbfdb2e64b renamed filter args to _filter to avoid confusion with built in filter() 2013-04-30 16:38:01 +02:00
Gregor Aisch
cfe4a0bef6 ensuring that table.all() works without id column (fixes #8) 2013-04-30 00:18:06 +02:00
Gregor Aisch
3ad013b1d1 find is now streaming large tables 2013-04-12 16:42:22 +02:00
Gregor Aisch
875e0508f2 insert returns last_id (closes #4) 2013-04-06 03:06:51 +02:00
Gregor Aisch
d58ec61b90 fixed bug in deletion of all rows 2013-04-05 11:54:12 +02:00
Gregor Aisch
9de0ad3e82 updated api docs 2013-04-05 00:49:13 +02:00
Gregor Aisch
ee844732b2 fixed table dropping 2013-04-05 00:47:28 +02:00
Gregor Aisch
fe3e5f5df5 checking if a table has been dropped 2013-04-05 00:31:21 +02:00
Friedrich Lindenberg
5cfa9abfb0 Adapt data freeze code base to integrate with dataset.persistence 2013-04-04 23:53:37 +02:00
Gregor Aisch
4d9ecb2532 replaced with more meaningful example 2013-04-04 20:08:39 +02:00
Gregor Aisch
3bf3b1dac1 fixed insert() example 2013-04-04 20:05:27 +02:00
Gregor Aisch
da2be5bc62 made chunk_size customizable 2013-04-04 19:44:28 +02:00
Gregor Aisch
ec0d2d61f7 added insert_many 2013-04-04 15:43:05 +02:00
Friedrich Lindenberg
f3533de1a7 merge. 2013-04-03 22:27:06 +02:00
Gregor Aisch
b39e4b193a fine-tuning the documentation 2013-04-03 12:46:10 +02:00
Gregor Aisch
258e3f3059 Allowing for direct iteration over rows in a table 2013-04-03 12:28:32 +02:00
Gregor Aisch
c284d05bd6 docs! 2013-04-03 01:48:26 +02:00
Gregor Aisch
4e78c96370 KeyError wasn't evaluated 2013-04-03 00:56:07 +02:00
Gregor Aisch
e0b66510ab removed sphinx warnings 2013-04-03 00:51:33 +02:00
Gregor Aisch
b5a759087a docs! 2013-04-02 23:45:44 +02:00
Gregor Aisch
f8e6d53bb5 docs! 2013-04-02 13:44:14 +02:00
Gregor Aisch
4d503f42e3 allow sorting by multiple columns and descending order 2013-04-02 13:17:30 +02:00
Gregor Aisch
58c1773777 documentation! 2013-04-02 11:10:29 +02:00
Friedrich Lindenberg
82153522cb Document delete() and all() 2013-04-02 00:20:02 +02:00
Friedrich Lindenberg
e58ffdafde Some additional doc. 2013-04-02 00:10:07 +02:00
Friedrich Lindenberg
0f81dbe52c More unit tests for table. 2013-04-01 22:03:01 +02:00
Friedrich Lindenberg
7c5779da80 More tests on table 2013-04-01 19:56:14 +02:00
Friedrich Lindenberg
8a97902762 Build up test cases a bit 2013-04-01 19:46:17 +02:00
Friedrich Lindenberg
b723b7da7c Refactor to simplify 2013-04-01 19:28:22 +02:00
Friedrich Lindenberg
d3fe91bc73 Moved everything into the OO api, not really tested … 2013-04-01 19:06:14 +02:00
Friedrich Lindenberg
30867fad21 Refactor more stuff up to an object. 2013-04-01 18:05:41 +02:00