Postgres: Operations, Hooks, OAuth login, Files support #2528

Merged
merged 16 commits into from Aug 18, 2016

Projects

None yet

3 participants

@flovilmart
Collaborator
  • Remove flaky tests on recursive roles load
@flovilmart flovilmart Adds files related tests through fs-adapter with PG
6fc13d5
@flovilmart flovilmart Schema deletions implementations
7698841
@ghost
ghost commented Aug 16, 2016

@flovilmart updated the pull request.

flovilmart added some commits Aug 16, 2016
@flovilmart flovilmart Adds Hooks spec da79889
@flovilmart flovilmart Fix test
028af56
@codecov-io
codecov-io commented Aug 16, 2016 edited

Current coverage is 92.20% (diff: 98.30%)

Merging #2528 into master will increase coverage by 0.27%

@@             master      #2528   diff @@
==========================================
  Files            96         97     +1   
  Lines         10892      11814   +922   
  Methods        1345       1454   +109   
  Messages          0          0          
  Branches       1759       1906   +147   
==========================================
+ Hits          10013      10893   +880   
- Misses          879        921    +42   
  Partials          0          0          

Powered by Codecov. Last update 3164b47...7258d40

@flovilmart flovilmart Adds support for containsAll (numbers and strings)
0d9c05b
@ghost
ghost commented Aug 16, 2016

@flovilmart updated the pull request.

@drew-gross drew-gross and 1 other commented on an outdated diff Aug 16, 2016
src/Adapters/Storage/Postgres/PostgresStorageAdapter.js
@@ -412,7 +454,20 @@ 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 notImplemented();
+ return this.getClass(className).then((schema) => {
+ let joins = joinTablesForSchema(schema);
@drew-gross
drew-gross Aug 16, 2016 Collaborator

Doesn't parse server drop the join tables automatically?

@flovilmart
flovilmart Aug 16, 2016 Collaborator

I'll try

@flovilmart
flovilmart Aug 16, 2016 Collaborator

I can confirm that can be simplified !

@flovilmart flovilmart Better support for deleteFields and deleteClass
5112474
@ghost
ghost commented Aug 16, 2016

@flovilmart updated the pull request - view changes

@flovilmart flovilmart commented on the diff Aug 16, 2016
.istanbul.yml
@@ -1,2 +1,2 @@
instrumentation:
- excludes: ["**/spec/**", "**/PostgresStorageAdapter.js"]
+ excludes: ["**/spec/**"]
@flovilmart
flovilmart Aug 16, 2016 Collaborator

Yay let's start covering dat!

@flovilmart flovilmart Recursive JSON update for authData
e5735eb
@ghost
ghost commented Aug 16, 2016

@flovilmart updated the pull request.

flovilmart added some commits Aug 16, 2016
@flovilmart flovilmart Adds node_modules to travis cache bb294d3
@flovilmart flovilmart Disable temporarily to make tests pass
bf81087
@ghost
ghost commented Aug 16, 2016

@flovilmart updated the pull request.

flovilmart added some commits Aug 16, 2016
@flovilmart flovilmart Adds _perishable_token support for _User class 49ac802
@flovilmart flovilmart ignore when a table creation fails at init (table exists) 8c33182
@flovilmart flovilmart Adds support for AddUnique and Remove
4da26f2
@flovilmart flovilmart PG 9.4 compatible functions
7bb22b4
@flovilmart flovilmart Re-enable tests
be8644f
@flovilmart flovilmart changed the title from Adds files related tests through fs-adapter with PG to Postgres: Operations, Hooks, OAuth login, Files support Aug 18, 2016
@drew-gross drew-gross and 1 other commented on an outdated diff Aug 18, 2016
src/Adapters/Storage/Postgres/PostgresStorageAdapter.js
// Table already exists, must have been created by a different request. Ignore error.
} else {
throw error;
}
}).then(() => {
// Create the relation tables
return Promise.all(relations.map((fieldName) => {
- return this._client.none('CREATE TABLE IF NOT EXISTS $<joinTable:name> ("relatedId" varChar(120), "owningId" varChar(120), PRIMARY KEY("relatedId", "owningId") )', {joinTable: `_Join:${fieldName}:${className}`})
+ return this._client.none('CREATE TABLE IF NOT EXISTS $<joinTable:name> ("relatedId" varChar(120), "owningId" varChar(120), PRIMARY KEY("relatedId", "owningId") )', {joinTable: `_Join:${fieldName}:${className}`}).catch(err => {
+ console.error('ERROR CREATING JOIN!')
@drew-gross
drew-gross Aug 18, 2016 Collaborator

You sure we want to squelch this error?

@flovilmart
flovilmart Aug 18, 2016 Collaborator

Nope, I don't want to :p

@flovilmart flovilmart nit
8bb493b
@ghost
ghost commented Aug 18, 2016

@flovilmart updated the pull request - view changes

@flovilmart flovilmart Better handling of schema creation race
7258d40
@ghost
ghost commented Aug 18, 2016

@flovilmart updated the pull request - view changes

@flovilmart flovilmart merged commit 9ecb9a3 into master Aug 18, 2016

2 checks passed

codecov/project 92.20% (target 90.00%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@flovilmart flovilmart deleted the pg-all-the-way branch Aug 20, 2016
@caoer caoer added a commit to caoer/parse-server that referenced this pull request Aug 29, 2016
@caoer caoer Merge remote-tracking branch 'ParsePlatform/master'
* ParsePlatform/master: (100 commits)
  Only allow basic auth credentials with a known appId (#2574)
  vk.com provider registered (#2579)
  chore(package): update parse-server-push-adapter to version 1.1.0 (#2588)
  vk.com auth data manager implemented (#2578)
  Fix a typo (#2563)
  Makes sure routes don't overlap and yield a header set error (#2559)
  Postgres: $all, $and CLP and more (#2551)
  Changelog 2.2.18 (#2558)
  chore(package): update winston-daily-rotate-file to version 1.3.0 (#2547)
  chore(package): update parse-server-s3-adapter to version 1.0.5 (#2536)
  Adds bcrypt native binding for better login performance (#2549)
  chore(package): update mongodb to version 2.2.7 (#2554)
  Make parse-server cloud code logging closer parse.com legacy (#2550)
  chore(package): update pg-promise to version 5.3.1 (#2519)
  Postgres: Operations, Hooks, OAuth login, Files support (#2528)
  Syncing afterSave/afterDelete trigger calls (Issue #2489) (#2499)
  Updated README.md (#2538)
  Fix capitalization, typo, and grammar mistake (#2533)
  Update ISSUE_TEMPLATE.md
  fix typo (#2525)
  ...
4da46a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment