Commit Graph

5 Commits

Author SHA1 Message Date
Michel Weststrate
0b528f19ce Escape table names and keys
Summary:
https://github.com/facebook/flipper/issues/1426

Changelog: [Databases] Fixed escaping of column names, see #1426

Reviewed By: jknoxville

Differential Revision: D23293248

fbshipit-source-id: 6acbb87727524ba2bdc7973cad8c124a3ee026e6
2020-08-24 08:08:25 -07:00
Chaiwat Ekkaewnumchai
525d0e9925 Add Test Case for Single Quote and Fix Logic
Summary: Single quotes need to be double to be correctly recognized in queries. #thanks mweststrate for reminding me

Reviewed By: mweststrate

Differential Revision: D21908315

fbshipit-source-id: 6c13f9ddb527d1144cc3df90ba48bdb5f2ed4952
2020-06-08 09:00:04 -07:00
Chaiwat Ekkaewnumchai
230b9528cf Unit Test for UpdateQueryUtil
Summary:
per title

Also, edit file to match tests

Reviewed By: mweststrate

Differential Revision: D21819748

fbshipit-source-id: b697ae9915c53162624ba90fc867676c9ca8733b
2020-06-02 08:19:42 -07:00
Chaiwat Ekkaewnumchai
54bf6440de Allow to Edit only When There Is Primary Key in Table
Summary: To be able to edit correct cell, identifiers are needed. Assume that the primary key is unique, this should be safe to allow the query to find exactly one row to edit

Reviewed By: jknoxville

Differential Revision: D21788239

fbshipit-source-id: b09d1b6da1b46cbc961f08010467e973546acbef
2020-06-02 01:47:06 -07:00
Chaiwat Ekkaewnumchai
5a2221e6cd Add Logic to Edit And Update Database on Both Client And Server
Summary:
This logic relies on the logic on client side, specifically `SqliteDatabaseDriver.java` in specifying some keys to retrieve useful data in `currentStructure`. This will be error-prone if developer writes their own data driver which doesn't follow the same naming as the data driver used as model.
Also, this diff adds util file to deal with query for updating database on client side.

I decided to construct query clause on server side so that the client side change is not needed.

Reviewed By: jknoxville

Differential Revision: D21788241

fbshipit-source-id: cf9a920c3e5b7b29f619bc3f00e68616b3445cab
2020-06-02 01:47:06 -07:00