Skip to content
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

Adding proper generic Not Implemented. #2292

Merged
merged 1 commit into from
Jul 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/Adapters/Storage/Postgres/PostgresStorageAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ export class PostgresStorageAdapter {
};

classExists(name) {
return Promise.reject('Not implemented yet.')
return notImplemented();
}

setClassLevelPermissions(className, CLPs) {
return Promise.reject('Not implemented yet.')
return notImplemented();
}

createClass(className, schema) {
Expand Down Expand Up @@ -172,7 +172,7 @@ export class PostgresStorageAdapter {
// Drops a collection. Resolves with true if it was a Parse Schema (eg. _User, Custom, etc.)
// and resolves with false if it wasn't (eg. a join table). Rejects if deletion was impossible.
deleteClass(className) {
return Promise.reject('Not implemented yet.')
return notImplemented();
}

// Delete all data known to this adapter. Used for testing.
Expand Down Expand Up @@ -205,7 +205,7 @@ export class PostgresStorageAdapter {

// Returns a Promise.
deleteFields(className, schema, fieldNames) {
return Promise.reject('Not implemented yet.')
return notImplemented();
}

// Return a promise for all schemas known to this adapter, in Parse format. In case the
Expand Down Expand Up @@ -298,7 +298,7 @@ export class PostgresStorageAdapter {

// Apply the update to all objects that match the given Parse Query.
updateObjectsByQuery(className, schema, query, update) {
return Promise.reject('Not implemented yet.')
return notImplemented();
}

// Return value not currently well specified.
Expand Down Expand Up @@ -349,7 +349,7 @@ export class PostgresStorageAdapter {

// Hopefully, we can get rid of this. It's only used for config and hooks.
upsertOneObject(className, schema, query, update) {
return Promise.reject('Not implemented yet.')
return notImplemented();
}

find(className, schema, query, { skip, limit, sort }) {
Expand Down Expand Up @@ -427,5 +427,9 @@ export class PostgresStorageAdapter {
}
}

function notImplemented() {
return Promise.reject(new Error('Not implemented yet.'));
}

export default PostgresStorageAdapter;
module.exports = PostgresStorageAdapter; // Required for tests