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

Raw database drivers #82

Merged
merged 13 commits into from
Nov 6, 2023
Merged

Raw database drivers #82

merged 13 commits into from
Nov 6, 2023

Conversation

an7e
Copy link
Contributor

@an7e an7e commented Nov 1, 2023

Changes proposed in this PR: #29

  • added Typesense class
  • added tests for Typesense class

Run tests

Before running tests, please run Typesense docker

docker-compose -f typesense-compose.yml -p ocean-node up -d

You can then run tests

npm run test

@an7e an7e changed the base branch from main to develop November 1, 2023 17:16
@an7e an7e linked an issue Nov 1, 2023 that may be closed by this pull request
2 tasks
@an7e an7e marked this pull request as ready for review November 2, 2023 14:08
Copy link
Member

@alexcos20 alexcos20 left a comment

Choose a reason for hiding this comment

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

Just running "npm run test" and..

Test Suites: 1 failed, 1 total
Tests:       15 failed, 2 passed, 17 total
Snapshots:   0 total
Time:        4.247 s

Assuming that I have no ideea what this PR is about, what should I do next ?

TO DO:

  • describe how to test your PR :)

Copy link
Contributor

@paulo-ocean paulo-ocean left a comment

Choose a reason for hiding this comment

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

Hi @an7e
could you please add some comments on your code? Its a bit hard to understand all what is going on without any comments :-) .
Also, we have a Logger utility under /utils/logging/Logger.ts
i think we should try to make use of that.
thanks

@an7e
Copy link
Contributor Author

an7e commented Nov 2, 2023

Just running "npm run test" and..

Test Suites: 1 failed, 1 total
Tests:       15 failed, 2 passed, 17 total
Snapshots:   0 total
Time:        4.247 s

Assuming that I have no ideea what this PR is about, what should I do next ?

TO DO:

  • describe how to test your PR :)

@an7e an7e closed this Nov 2, 2023
@an7e an7e reopened this Nov 2, 2023
@an7e
Copy link
Contributor Author

an7e commented Nov 2, 2023

sorry, miss clicked on Close

@an7e
Copy link
Contributor Author

an7e commented Nov 2, 2023

Just running "npm run test" and..

Test Suites: 1 failed, 1 total
Tests:       15 failed, 2 passed, 17 total
Snapshots:   0 total
Time:        4.247 s

Assuming that I have no ideea what this PR is about, what should I do next ?

TO DO:

  • describe how to test your PR :)

Run tests

Before running tests, please run Typesense docker

docker-compose -f typesense-compose.yml -p ocean-node up -d

You can then run tests

npm run test

@an7e
Copy link
Contributor Author

an7e commented Nov 2, 2023

@alexcos20 I added note about tests in PR description and made commit to README

@an7e
Copy link
Contributor Author

an7e commented Nov 2, 2023

@paulo-ocean

  • about Logger
    When we using Typesense class we can specifying logger parameter when creating object instance, see tests for example

  • about comments
    What kind of comments do you want?
    Maybe a brief description of classes or methods?
    Also a question for @alexcos20 do we need comments and how detailed should they be?

@paulo-ocean
Copy link
Contributor

paulo-ocean commented Nov 2, 2023

@paulo-ocean

  • about Logger
    When we using Typesense class we can specifying logger parameter when creating object instance, see tests for example
    Yes, but we already created a customized wrapper / logger utility around 'winston'... to centralize/normalize logging, but you're not using any of that, so the handling of this logging here is already different
  • about comments
    What kind of comments do you want?
    Maybe a brief description of classes or methods?
    Yes, at least some comments :-) , could be something brief. There is not a single line of comment. It doesn't need to go into any impl details, but at least some brief description of the purpose of some more complex classes or functions, to have a little context for others
    Also a question for @alexcos20 do we need comments and how detailed should they be?

@an7e
Copy link
Contributor Author

an7e commented Nov 3, 2023

@paulo-ocean

  • about Logger
    When we using Typesense class we can specifying logger parameter when creating object instance, see tests for example
    Yes, but we already created a customized wrapper / logger utility around 'winston'... to centralize/normalize logging, but you're not using any of that, so the handling of this logging here is already different
  • about comments
    What kind of comments do you want?
    Maybe a brief description of classes or methods?
    Yes, at least some comments :-) , could be something brief. There is not a single line of comment. It doesn't need to go into any impl details, but at least some brief description of the purpose of some more complex classes or functions, to have a little context for others
    Also a question for @alexcos20 do we need comments and how detailed should they be?

@paulo-ocean
To avoid misunderstandings about the logger, I have changed the code a bit
The point is, let's say we have a Logger class that logs something, ok.
We create class A that says, I can log, but give me a logger, any logger that supports the usual logging interface.
Then when someone uses my class A, they will create a logger, today it's winston, tomorrow it's pino, it doesn't matter, and pass it as a logger parameter.

const logger = new MyNewBrandCustomLogger()
const a = new A({logger: logger})

@paulo-ocean
Also wrote some comments about classes, hope this helps

@paulo-ocean
Copy link
Contributor

@an7e LGTM, but check the conflicts before the merge

@alexcos20
Copy link
Member

@an7e
Copy link
Contributor Author

an7e commented Nov 6, 2023

do we really need coredb.ts when we have https://github.com/oceanprotocol/ocean-node/blob/raw-database-drivers/src/components/database/index.ts#L3 ?

@alexcos20
No, I'm gonna delete this

@an7e an7e requested a review from alexcos20 November 6, 2023 09:40
# Conflicts:
#	package-lock.json
#	package.json
@an7e an7e merged commit 0125729 into develop Nov 6, 2023
0 of 4 checks passed
@alexcos20 alexcos20 deleted the raw-database-drivers branch January 19, 2024 11:00
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.

Core: raw database drivers
3 participants