Commit graph

41 commits

Author SHA1 Message Date
Tobie Morgan Hitchcock
b886a5576a Return empty array if requested array range
If an array range was requested, but no values matched, then a nil value was returned, instead of an empty array.

Now an empty array is returned if regardless of whether there are any matching array values or not.
2018-05-13 22:15:54 +01:00
Tobie Morgan Hitchcock
b7d89ee65a Add support for foreign tables with group by clauses 2018-05-02 02:43:04 +01:00
Tobie Morgan Hitchcock
eb62515a05 Ensure that fields are not removed when set to NULL 2018-04-27 00:40:36 +01:00
Tobie Morgan Hitchcock
11a9fa05e6 Prevent race conditions in when fetching document fields 2018-04-24 13:53:15 +01:00
Tobie Morgan Hitchcock
1f30035899 Add SQL FETCH functionality to SELECT statements 2018-04-22 00:10:52 +01:00
Tobie Morgan Hitchcock
35047ce04c Improve remote array record fetching 2018-04-22 00:10:51 +01:00
Tobie Morgan Hitchcock
459c7264ec Don’t enable array lengths fetch using data paths 2018-04-20 21:33:13 +01:00
Tobie Morgan Hitchcock
ad4adbd986 Enable select * data from a foreign thing / record 2018-03-18 21:33:26 +00:00
Tobie Morgan Hitchcock
8076afd414 If adding to an empty value, set it as an array
If we have an empty field ‘test’ and we specify the sql `SET test += “test”` then we’ll presume it’s going to be an array if it isn’t a number or a decimal.
2017-12-11 17:52:02 +00:00
Tobie Morgan Hitchcock
edcd2d431c Only error if requesting a specific array index 2017-12-06 20:19:28 +00:00
Tobie Morgan Hitchcock
6e8fdaa2db Ensure nil fields are removed when SCHEMAFULL 2017-12-05 11:09:04 +00:00
Tobie Morgan Hitchcock
82df9dca86 Fix typo in comment 2017-12-03 00:44:07 +00:00
Tobie Morgan Hitchcock
eb7a9c2744 Add ability to retrieve different values
It is now possible to specify a function to manipulate each values stored in a data object, when retrieving that value. This enables storing compressed obejcts as strings, which are expanded when accessed. This is used to store *sql.Thing values, which when requested can access embedded fields by fetching and returning the full record when the *sql.Thing is requested.
2017-11-28 00:39:00 +00:00
Tobie Morgan Hitchcock
287951a37f Ensure we trim all data path parts before fetching values 2017-11-27 18:30:20 +00:00
Tobie Morgan Hitchcock
527f85f8e6 Implement both JsonMarshaler and JsonUnmarshaler
If a type only defines one-half of the symmetry (e.g. it implements MarshalJSON() but not UnmarshalJSON() ), then that type doesn't satisfy the codec encoding/decoding check and instead codec will not encode or decode the item using the special interface methods.
2017-11-24 10:55:13 +00:00
Tobie Morgan Hitchcock
428ad4312c Add an Append function which appends to a slice 2017-11-16 19:54:54 +00:00
Tobie Morgan Hitchcock
4640839231 Use switch statements instead of if statements 2017-11-16 19:54:54 +00:00
Tobie Morgan Hitchcock
d66e3d5866 When resetting a doc, reset it to an empty map 2017-11-16 19:54:54 +00:00
Tobie Morgan Hitchcock
3f68f1318c Copy should return a new document, not interface{} 2017-11-16 19:54:54 +00:00
Tobie Morgan Hitchcock
f7318dbbe8 Fix godoc comment 2017-06-09 18:57:16 +01:00
Tobie Morgan Hitchcock
ca6d0d86fd Fix bug when deleting range queries
When performing a range query on an array when deleting, the items which were supposed to be removed, ended up being the ones which were kept.

Not the ramining array items are kept instead when deleting.
2017-02-23 15:43:17 +00:00
Tobie Morgan Hitchcock
969179660b Enable data docs to self encode to JSON 2017-02-20 09:46:26 +00:00
Tobie Morgan Hitchcock
955e736a4d Enable expressive array item selection using [:] 2017-02-07 17:22:57 +00:00
Tobie Morgan Hitchcock
664ab1054c Add Diff method for comparing data docs 2017-02-04 11:23:30 +00:00
Tobie Morgan Hitchcock
e6df3dbeb9 Add Each method
Add Each method for iterating through all of the values in a document. This is in contrast to Walk which will iterate over a given path regardless of whether it exists or not.
2017-02-04 11:22:53 +00:00
Tobie Morgan Hitchcock
865a0b16a3 Improve path parsing enabling [] array characters 2017-02-04 11:13:11 +00:00
Tobie Morgan Hitchcock
db2fb6159c Specify struct fields on struct initialisation 2017-02-04 11:00:13 +00:00
Tobie Morgan Hitchcock
6bf826c466 Enable path walking with a callback function 2016-10-24 14:16:53 +01:00
Tobie Morgan Hitchcock
fd540a5237 Enable checking for existing and non-null items 2016-10-24 14:16:42 +01:00
Tobie Morgan Hitchcock
99d9657d80 Enable getting array items directly 2016-10-24 14:16:14 +01:00
Tobie Morgan Hitchcock
58b9cf3478 Use go fmt simplify 2016-10-14 07:52:33 +01:00
Tobie Morgan Hitchcock
25c86a49da Use cork serialization for data storage 2016-10-02 00:17:19 +01:00
Tobie Morgan Hitchcock
1fd0ddafe4 Fix godoc comments 2016-09-28 12:33:07 +01:00
Tobie Morgan Hitchcock
701125b879 No need for ability to export as JSON 2016-09-28 12:32:41 +01:00
Tobie Morgan Hitchcock
aa4f788566 Use generic pack.Encode + pack.Decode methods 2016-09-19 12:02:42 +01:00
Tobie Morgan Hitchcock
dc3793d03d Use BINC encoding instead of MsgPACK for storage 2016-09-14 22:26:41 +01:00
Tobie Morgan Hitchcock
dfa9182711 Use deep copy instead of gob encode/decode 2016-09-12 16:47:22 +01:00
Tobie Morgan Hitchcock
0f420d2cae Add ability to get object keys and object values 2016-09-09 18:55:25 +01:00
Tobie Morgan Hitchcock
b5a15a85ae Improve json transformation utility package 2016-09-06 12:39:33 +01:00
Tobie Morgan Hitchcock
be182d6c9a Change Search to Get 2016-06-16 13:32:54 +01:00
Tobie Morgan Hitchcock
0e21d585ba Move 'json' package to 'data' 2016-05-17 22:38:06 +01:00