-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Rename ExportAdapter to DatabaseController, start splitting Mongo specific logic. #698
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
Conversation
d18e8b5
to
b70c9bf
Compare
@nlutsenko updated the pull request. |
|
||
// options can contain: | ||
// collectionPrefix: the string to put in front of every collection name. | ||
function ExportAdapter(mongoURI, options = {}) { | ||
this.mongoURI = mongoURI; | ||
function DatabaseController(adapter, { collectionPrefix } = {}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may wanna use AdaptableController here as it ensures the prototype of the adapter matches the expected adapter prototype
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, a little bit later tho.
One optional nit, otherwise looks good to me. The cleanup around |
b70c9bf
to
eb89283
Compare
@nlutsenko updated the pull request. |
Rename ExportAdapter to DatabaseController, start splitting Mongo specific logic.
more rebase madness for #627 ! |
This is a first PR that kickstarts the effort to move use away from Mongo-specific storage, and implement Postgres.
After playing with 3-5 different approaches, turns out that the best one is to reuse all the logic that we have right now in ExportAdapter, and then decouple piece by piece away from it. This still guarantees that we are not duplicating logic/names/classes/functions, but are moving into storage-independent future.
Now back to this PR:
Turns out that by doing all of this - we also can kill the requirement for calling
connect()
on the DatabaseController before any operation.cc @lacker, @gfosco