Skip to content
This repository was archived by the owner on Apr 7, 2023. It is now read-only.

Conversation

@jonseitz
Copy link
Contributor

@jonseitz jonseitz commented Mar 8, 2021

Kind of breaking form by doing this initial implementation in develop, but given that it's a very small library I don't think that's a huge issue.

This sets up our OracleWrapper class, which is based on the OracleDB class that's defined as part of the EAF ETL process, with some small changes aimed at making the class more generalizable. It's also in Typescript now too.

The tests are all pretty basic unit tests. I had spent some time trying to get a oracle database container running for more invovled integration tests but there's just not a great solution for doing that quickly.

There's a weird conflict between the eslint rule and the
typescript-eslint rule re: comma-dangle, so we need to make sure it's
defined the same for both.
Defines our OracleWrapper class, which just simplifies the process of
creating connection pools and running large queries against the
database.
Since we're the primary audience for this, we'll add the @seas-computing
namespace for publishing on npm.
Installs the latest version of typedoc, which requires some changes to the
config file options.
@jonseitz jonseitz requested a review from rmainwork March 8, 2021 18:37
Copy link

@rmainwork rmainwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this looks great. Just a few small issues. Looking forward to having this going forward!

src/index.ts Outdated
public async releasePool(): Promise<void> {
if (this.connectionPool) {
try {
await this.connectionPool.close(60);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might it be worth having 60 as a configurable property in the constructor (or as a class constant)? Rather than a magic number in the method like this...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I made all the magic numbers configurable in 01f8ff1

The original implementation did not allow configuration of some of the
connection options, but there is a reasonable case for making more of
them configurable to accomodate different circumstances.
In addition to logging a message about the error, we can also log the
full error object.
We only really need to diable the dot-notation rule in order to access
private properties with bracket notation, so we should specify that in
the eslint-disable-next-line directive
Since we're now merging the default options and user options, we don't
really need to check the conditional assignment. That would just be
testing that the `...` operator  works.

Additionally, we don't really need to test that the alias is being added
to the poolCredentials property, and there's no point in having
pointless tests.
This is more in line with our style, and generally streamlines the
tests by cutting down the amount of data instantiation that needs to
happen.
This is for consistency with our other projects.
Provides some additional context for why those tests would be failing,
if they failed
Copy link

@rmainwork rmainwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, still a couple more things.

The spacing for documentation was all over the place, but the most
consistent inconsistency seemed to be

1.) blank line above the docblock
2.) no blank line between the docblock and the thing being documented
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (main@565940b). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             main        #1   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?         1           
  Lines           ?        58           
  Branches        ?         7           
========================================
  Hits            ?        58           
  Misses          ?         0           
  Partials        ?         0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 565940b...d7d4759. Read the comment docs.

@jonseitz jonseitz merged commit 58bf039 into main Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants