-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DBController refactoring #1228
DBController refactoring #1228
Conversation
Current coverage is
|
I don't think we want this. Obviously we wouldn't be able to use it internally, or the entire concept of database adapters won't work. If someone wants direct DB access in their cloud code, they can just use the driver like they would if they weren't writing a Parse app. |
This is not to provide direct DB access, but skip className and key validation so we can use The DB controller instead of the adaptive collection. Problem with adaptive collection is that it's highly opinionated towards the driver. Updated the misleading description |
f29495d
to
55d91e4
Compare
@flovilmart updated the pull request. |
Rather than allowing the "unsafe" version to do anything at all, can we just allow it to write classes and fields that start with an underscore? Also I think @nlutsenko's strategy with the adaptive collection was to first make it less tightly coupled, and then make it less opinionated in a separate phase. |
That's the goal of the unsafe. Not sure we're not saying the same thing differently. The problem with the adaptiveCollection abstraction, is that it would force to move all transformations inside the collection instead of outside, in DBController ---> REST format ---> DBController -- adapter.transform -> adaptiveCollection With this architecture the adapter is fully and solely responsible to transform, untransform, store and retrieve data. The DBController orchestrates all operations, and takes REST format and returns REST format. The rest of the module only talks in REST to the DBAdapater, abstracting to the right level. For a SQL DB, as the transform would spit out strings that would be passed as is to the adapativeCollection. AdaptiveCollectoon means that it's an adapter specific collection, not a collection that takes a standard query format. |
55d91e4
to
fed1949
Compare
@flovilmart updated the pull request. |
fed1949
to
7c2020d
Compare
@flovilmart updated the pull request. |
7c2020d
to
ce1e5bf
Compare
Sorry, sir, looks like this needs rebase. :) Pass back hen you are done. |
ce1e5bf
to
7426d18
Compare
@nlutsenko it's all yours! |
7426d18
to
b98ca44
Compare
@flovilmart updated the pull request. |
b98ca44
to
56c97bb
Compare
@flovilmart updated the pull request. |
56c97bb
to
cd7e09e
Compare
@flovilmart updated the pull request. |
@drew-gross , @nlutsenko what should we do with that PR? That makes the internals use the proper Rest format, I'm open to refactor differently/further if needed. |
I had been planning to let @nlutsenko continue with reviewing since he has done more of the db adapter code, and has more context on how it should work. |
I'll take a look at it after F8 (which is tomorrow and Wednesday). |
Good luck for F8! Let me know when you get some time on slack, if it needs a rebase at that time I'll do a quick one. |
@flovilmart updated the pull request. |
1b5d53b
to
a568a98
Compare
@flovilmart updated the pull request. |
a568a98
to
2cdfb25
Compare
- Adds ACL query injection in MongoTransform
@flovilmart updated the pull request. |
2cdfb25
to
035146b
Compare
@flovilmart updated the pull request. |
- All collections manipulations are now handled by a DBController - Adds optional flags to configure an unsafe databaseController for direct access - Adds ability to configure RestWrite with multiple writes - Moves some transfirmations to MongoTransform as they output specific code
035146b
to
5c7c7e4
Compare
@flovilmart updated the pull request. |
I think @nlutsenko is busy and this looks pretty solid to me and passes tests. The DB Adapter API will need a lot of changes anyway so I say might as well merge. |
Alright then! |
Removes adaptiveCollection from DatabaseController