Commit graph

919 commits

Author SHA1 Message Date
Tobie Morgan Hitchcock
b8972ae2c2 Mathmatical sql functions must be prefixed with ‘math’
All mathmatical functions must now be used by specifying the full function name. For example `avg` is now `math.avg`.
2018-04-05 00:34:09 +01:00
Tobie Morgan Hitchcock
6c3ae600f8 Remove unused snappy compression package 2018-04-04 19:27:46 +01:00
Tobie Morgan Hitchcock
0dc9ad339c Enable multiple expressions with database events
It is now possible to run multiple query expressions when an event on a table has occured. Query expressions can be separated with a semicolon, and will be run in the same transaction as the main query.
2018-04-04 19:20:07 +01:00
Tobie Morgan Hitchcock
86a911b4a8 Improve tests for DB indexes 2018-04-04 19:16:32 +01:00
Tobie Morgan Hitchcock
82ffd9ef31 Fix bug in putC/delC for mysql storage backend
When using encryption, the expected value (once encrypted) would never be the same as the encrypted value in the storage layer. As a result, it would never be possible to putC or delC a KV item.

Now the mysql package first gets the key from the storage layer, and then checks it’s decrypted value, before attempting to overwirte the value in the storage layer.
2018-04-04 19:11:59 +01:00
Tobie Morgan Hitchcock
085ba565b2 The SQL function string.reverse should take 1 argument 2018-04-02 23:44:51 +01:00
Tobie Morgan Hitchcock
7c39c99bf3 Ensure correct index values are inserted 2018-04-01 00:33:51 +01:00
Tobie Morgan Hitchcock
0a85084b8e Use alpine linux for base docker image 2018-03-19 11:47:29 +00:00
Tobie Morgan Hitchcock
160986cc0b Shorten test timeout time to prevent test failure 2018-03-19 11:35:31 +00:00
Tobie Morgan Hitchcock
6d60b2ff4d Use scratch Docker container for surreal build 2018-03-19 11:33:28 +00:00
Tobie Morgan Hitchcock
13e89972fa Don’t do race detection testing in CI environment 2018-03-19 11:32:38 +00:00
Tobie Morgan Hitchcock
a21e3daa0b Enable race detection testing in CI environment 2018-03-19 09:05:23 +00:00
Tobie Morgan Hitchcock
b4a8f10cdc Ensure query variables are consistent
All request variables which are assigned to an sql query are now specified in one location, ensuring that they are consistent and always present for all queries.
2018-03-18 21:38:21 +00:00
Tobie Morgan Hitchcock
ad4adbd986 Enable select * data from a foreign thing / record 2018-03-18 21:33:26 +00:00
Tobie Morgan Hitchcock
ca392f87a7 Add ON SIGNUP and ON SIGNIN events to SQL SCOPE
It is now possible to run queries when a user signs-up or signs-in, by specifying multiple queries within an ON SIGNUP (…) clause, or a ON SIGNIN (...) clause.
2018-03-18 21:30:02 +00:00
Tobie Morgan Hitchcock
0dae9d2366 Add sql.MultExpression type 2018-03-18 21:01:29 +00:00
Tobie Morgan Hitchcock
f77daca0da Simplify subquery parsing 2018-03-18 20:01:41 +00:00
Tobie Morgan Hitchcock
3436634586 Add SQL either function for simplified IF ELSE clauses 2018-03-18 19:03:14 +00:00
Tobie Morgan Hitchcock
cc85b86ced Fix incorrect fmt.Sprintf input arguments 2018-03-18 18:58:30 +00:00
Tobie Morgan Hitchcock
d70d063797 Make JWT token values available to scope CONNECT query 2018-03-02 11:03:19 +00:00
Tobie Morgan Hitchcock
aebc001229 Store IP address in JWT token 2018-03-02 11:02:47 +00:00
Tobie Morgan Hitchcock
069baf71b7 Empty strings now match an EMPTY sql clause 2018-02-17 09:23:51 +00:00
Tobie Morgan Hitchcock
bece5d1f07 Ensure we run signUp not signIn when signing up 2018-02-17 09:14:26 +00:00
Tobie Morgan Hitchcock
87cf68b213 Don’t log context auth data 2018-02-14 15:48:55 +00:00
Tobie Morgan Hitchcock
b4dfaf2898 Don’t assert the value of a field type
Previously if a field had a type, and a value was entered which did not match that type, then an error was raised, even though the ASSERT clause was not set. Now the field will be set to nil if the field does not match the specified type, and the ASSERT clause can be used to ensure that a valid value is always entered.
2018-02-14 15:48:42 +00:00
Tobie Morgan Hitchcock
2249086887 Improve rpc authentication methods 2018-02-14 13:19:43 +00:00
Tobie Morgan Hitchcock
c47fe55ffb Ensure any previous auth data is reset if authentication fails 2018-02-14 13:17:05 +00:00
Tobie Morgan Hitchcock
31c7849643 No need to cast, incase the value is not set on the context 2018-02-14 13:15:56 +00:00
Tobie Morgan Hitchcock
76837325d0 Update 3rd party dependencies 2018-02-12 22:26:17 +00:00
Tobie Morgan Hitchcock
e073bf2775 Enable persistent request variables
It is now possible to set a variable on a connection, and use that variable in multiple subsequent queries. This ensures that websockets can make use of state variables for detecting logged-in, and non-logged-in clients.
2018-02-12 22:13:36 +00:00
Tobie Morgan Hitchcock
15e9f77434 Add Uniq() rpc method for crypto-secure rando ids 2018-02-12 21:50:19 +00:00
Tobie Morgan Hitchcock
779251bc54 Simplify auth data response on rpc requests
Ther is no need to return all auth data when caling the Info() and Auth(token) rpc functions. Instead only the id needs to be returned to the consuming application.
2018-02-12 21:48:55 +00:00
Tobie Morgan Hitchcock
1dba4e4c89 Add string genrator function to util/rand package 2018-02-12 21:38:08 +00:00
Tobie Morgan Hitchcock
926ef37234 LET and RETURN should not need SC level permissions 2018-02-12 15:38:34 +00:00
Tobie Morgan Hitchcock
9b0ef8d6d7 When clearing an index, remove all items 2018-02-12 09:05:52 +00:00
Tobie Morgan Hitchcock
bb8c623f88 Don’t use readonly transactions for mysql 2018-02-11 16:43:59 +00:00
Tobie Morgan Hitchcock
5c18ee20a7 Log errors which occur on the kvs layer 2018-02-11 16:43:49 +00:00
Tobie Morgan Hitchcock
8b508b09c6 Don’t use non-default isolation level for mysql 2018-02-11 16:14:42 +00:00
Tobie Morgan Hitchcock
3194253b71 Update 3rd party dependencies 2018-02-11 09:40:15 +00:00
Tobie Morgan Hitchcock
02ef06a1d2 Increase the limit when fetching batch items from the kvs 2018-02-11 00:17:16 +00:00
Tobie Morgan Hitchcock
ccf57df085 Add support for mysql as a backend kv store 2018-02-11 00:16:28 +00:00
Tobie Morgan Hitchcock
84b72e25d2 Don’t use of ClrL, GetL, DelL, PutL methods on KV store
Remove the need to query a particular KV level, and instead use slightly different encoded keys, and use prefix based iteration. This means we can use different KV stores to give the same functionality, without needing to use hierarchical KV stores.
2018-02-09 15:08:27 +00:00
Tobie Morgan Hitchcock
8cce4ad185 No need for PutC as we always already have the record value
We don’t need to check whether the record already exists, as we always have any record contents when we are procesing a document. Therefore we already know if a document exists or not in the kv store.
2018-02-08 10:59:54 +00:00
Tobie Morgan Hitchcock
dc6a357e26 Enable passing context when beginning a transaction 2018-02-06 17:07:42 +00:00
Tobie Morgan Hitchcock
788d19c498 Fix godoc comments 2018-02-06 17:05:26 +00:00
Tobie Morgan Hitchcock
36e7d8ed3a Flush websocket notifications correctly
Websocket notifications were cleared/flushed regardless of whether individual statements were successful or not.

Now notifications are shifted onto the stack, or removed if the statement is unsuccessful. Once the full query has been processed, all pending notifications are flushed to all websockets (ignoring the current connection frin which th query originated).
2018-01-31 09:15:29 +00:00
Tobie Morgan Hitchcock
a9883efc4a Improve error messages on authentication failure 2018-01-31 08:52:21 +00:00
Tobie Morgan Hitchcock
58b8b461e3 Enable specifying NS, DB, and auth through websocket protocols 2018-01-31 08:52:11 +00:00
Tobie Morgan Hitchcock
7a3355bff0 Enable customisable file size policies for storage backends 2018-01-12 11:10:11 +00:00
Tobie Morgan Hitchcock
afac8b405f Update 3rd party dependencies 2018-01-12 10:55:14 +00:00