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

fix(code-gen): allow 'optional' order by for deletedAt column #725

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

dirkdev98
Copy link
Member

Accidentally added the 'deletedAt' field to the exception list. That exception exists because the internal 'createdAt' & 'updatedAt' will never be 'NULL', so allowing 'ASC NULL LAST' doesn't have any effect on the output.

Also made the options named, which may result in a smaller validator output.

Removed the 'ASC NULLS LAST' & 'DESC NULLS FIRST' as they are the defaults for 'ASC' and 'DESC'

Accidentally added the 'deletedAt' field to the exception list. That exception exists because the internal 'createdAt' & 'updatedAt' will never be 'NULL', so allowing 'ASC NULL LAST' doesn't have any effect on the output.

Also made the options named, which may result in a smaller validator output.

Removed the 'ASC NULLS LAST' & 'DESC NULLS FIRST' as they are the defaults for 'ASC' and 'DESC'
@github-actions
Copy link
Contributor

==== Benchmark result ====

Node.js version: 14
Total benchmarks: 15
          Passed: 15
          Failed: 0
-----------
router - github static path              200000  iterations    7137  ns/op
router - github path params              200000  iterations    9172  ns/op
compas validator simple                 5000000  iterations     226  ns/op
yup validator simple                     100000  iterations   10825  ns/op
fastest-validator validator simple     20000000  iterations      95  ns/op
compas validator nested                 1000000  iterations    1214  ns/op
yup validator nested                      50000  iterations   39380  ns/op
fastest-validator validator nested      5000000  iterations     472  ns/op
logger - strings                         500000  iterations    2297  ns/op
logger - objects                         500000  iterations    2908  ns/op
logger - deep objects                    500000  iterations    5235  ns/op
uuid                                    5000000  iterations     429  ns/op
uuid.isValid                           10000000  iterations     119  ns/op
isNil                                 500000000  iterations       0  ns/op
isPlainObject                         100000000  iterations      16  ns/op

@github-actions
Copy link
Contributor

==== C8 test coverage ====
Statements: 67.18% ( 27963/41627 )
Branches : 63.89% ( 2981 /4666 )
Functions : 68.07% ( 923 /1356 )
Lines : 67.18% ( 27963 /41627 )

@dirkdev98 dirkdev98 force-pushed the fix/code-gen-sql-order-by branch from 86eee5a to b4e8025 Compare February 24, 2021 20:57
@github-actions
Copy link
Contributor

==== Benchmark result ====

Node.js version: 15
Total benchmarks: 15
          Passed: 15
          Failed: 0
-----------
router - github static path              200000  iterations    8422  ns/op
router - github path params              200000  iterations   10027  ns/op
compas validator simple                 5000000  iterations     248  ns/op
yup validator simple                     100000  iterations   11183  ns/op
fastest-validator validator simple     20000000  iterations      93  ns/op
compas validator nested                 1000000  iterations    1366  ns/op
yup validator nested                      50000  iterations   41576  ns/op
fastest-validator validator nested      5000000  iterations     501  ns/op
logger - strings                         500000  iterations    2475  ns/op
logger - objects                         500000  iterations    3056  ns/op
logger - deep objects                    200000  iterations    5823  ns/op
uuid                                    5000000  iterations     361  ns/op
uuid.isValid                           10000000  iterations     130  ns/op
isNil                                 500000000  iterations       0  ns/op
isPlainObject                         100000000  iterations      18  ns/op

@dirkdev98 dirkdev98 enabled auto-merge (squash) February 24, 2021 20:57
@github-actions
Copy link
Contributor

==== Benchmark result ====

Node.js version: 14
Total benchmarks: 15
          Passed: 15
          Failed: 0
-----------
router - github static path              200000  iterations    8725  ns/op
router - github path params              100000  iterations   10330  ns/op
compas validator simple                 5000000  iterations     251  ns/op
yup validator simple                     100000  iterations   11945  ns/op
fastest-validator validator simple     10000000  iterations     105  ns/op
compas validator nested                 1000000  iterations    1439  ns/op
yup validator nested                      50000  iterations   44727  ns/op
fastest-validator validator nested      2000000  iterations     544  ns/op
logger - strings                         500000  iterations    2593  ns/op
logger - objects                         500000  iterations    3191  ns/op
logger - deep objects                    200000  iterations    5626  ns/op
uuid                                    2000000  iterations     511  ns/op
uuid.isValid                           10000000  iterations     132  ns/op
isNil                                 500000000  iterations       0  ns/op
isPlainObject                         100000000  iterations      18  ns/op

@github-actions
Copy link
Contributor

==== C8 test coverage ====
Statements: 67.21% ( 27978/41627 )
Branches : 63.83% ( 2975 /4661 )
Functions : 68.73% ( 923 /1343 )
Lines : 67.21% ( 27978 /41627 )

@github-actions
Copy link
Contributor

==== Benchmark result ====

Node.js version: 15
Total benchmarks: 15
          Passed: 15
          Failed: 0
-----------
router - github static path              200000  iterations    8763  ns/op
router - github path params              200000  iterations   10024  ns/op
compas validator simple                 5000000  iterations     261  ns/op
yup validator simple                     100000  iterations   12088  ns/op
fastest-validator validator simple     10000000  iterations     120  ns/op
compas validator nested                 1000000  iterations    1495  ns/op
yup validator nested                      50000  iterations   38274  ns/op
fastest-validator validator nested      2000000  iterations     538  ns/op
logger - strings                         500000  iterations    2729  ns/op
logger - objects                         500000  iterations    3284  ns/op
logger - deep objects                    500000  iterations    4769  ns/op
uuid                                    5000000  iterations     368  ns/op
uuid.isValid                           10000000  iterations     162  ns/op
isNil                                 500000000  iterations       0  ns/op
isPlainObject                         100000000  iterations      20  ns/op

@dirkdev98 dirkdev98 merged commit d8236f5 into main Feb 24, 2021
@dirkdev98 dirkdev98 deleted the fix/code-gen-sql-order-by branch February 24, 2021 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant