-
Notifications
You must be signed in to change notification settings - Fork 17
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
Firestore implementation #26
Conversation
// const filterParser = new FilterParser() | ||
const dataProvider = new DataProvider(firestore) | ||
const filterParser = new FilterParser() | ||
const dataProvider = new DataProvider(firestore,filterParser) |
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.
add space after ','
const filterOperations = this.filterParser.transform(filter) | ||
const collectionRef = this.database.collection(collectionName) | ||
|
||
filterOperations.forEach( filterOp => collectionRef.where(filterOp.fieldName,filterOp.opStr,filterOp.value)) |
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.
fix to reduce
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.
and spaces after ',' (again)
async insert(collectionName, items) { | ||
const batch = this.database.batch() | ||
|
||
items.forEach( item => batch.set(this.database.doc(`${collectionName}/${item._id}`),item)); |
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.
reduce
return (await batch.commit()).length | ||
} | ||
|
||
fixDates(value) { |
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.
extract those two function to another file, utils perhaps ?
} | ||
|
||
items.forEach( item => | ||
batch.update(this.database.doc(`${collectionName}/${item._id}`),item)); |
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.
space after ','
shouldn't the forEach be a map or reduce here ?
|
||
async delete(collectionName, itemIds) { | ||
const batch = this.database.batch() | ||
itemIds.forEach( itemId => batch.delete(this.database.doc(`${collectionName}/${itemId}`)) ) |
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.
to reduce
return EMPTY_FILTER; | ||
} | ||
|
||
// return { |
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.
removed comments
return [] | ||
} | ||
|
||
// switch (filter.operator) { |
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.
what happens in case of $and/$or ?
return (await batch.commit()).length | ||
} | ||
|
||
asEntity(docEntity) { |
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.
extract
return value | ||
} | ||
|
||
const deleteQueryBatch = async (db, query, resolve) => { |
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.
this code cannot be here, it should be on the main impl firestore_data_provider.js
…est a specific engine
* first version azure-adapter-installer works now only for mysql, need to insert the enviorment variables (watch in init.js file) need to change the login method, get params method (not process.env) * add spinner * fix test error azure * nop
* fix mssql connection provider * add not connected synthetic pool * extract notConnectedPool func to mssql_utils
No description provided.