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

Feature/ add Elasticsearch database alternative for typesense #599

Open
wants to merge 158 commits into
base: main
Choose a base branch
from

Conversation

bogdanfazakas
Copy link
Member

@bogdanfazakas bogdanfazakas commented Aug 11, 2024

Fixes #590 .

Changes proposed in this PR:

  • create abstract base database classes
  • created factory to instantiate one of the available databases
  • add elastic implementation for typesense databases
  • add datatoken address, nftAddress, did in order index or schemas

@bogdanfazakas bogdanfazakas self-assigned this Aug 14, 2024
@alexcos20 alexcos20 changed the base branch from develop to main August 14, 2024 18:59
@jamiehewitt15
Copy link
Member

Looks like there are some conflicts, can you pull from main and resolve them?

@paulo-ocean
Copy link
Contributor

paulo-ocean commented Oct 3, 2024

i checked & fixed the conflicts on another branch. I think you can cherry-pick this commit for instance:
dcab22b
We lost some functionality there, for instance; we should not proceed to configure the DB transport if the DB url is not valid. That should be the first check
Also, not sure why you deleted the utils function to check DB configuration.. what's the point of that?
I'm also not sure about the try/catch on Database constructor (although i've kept it)...
If there is an error being Throw doesn't that break the server startup? We should be able to use the node without DB

@paulo-ocean
Copy link
Contributor

i checked & fixed the conflicts on another branch. I think you can cherry-pick this commit for instance: dcab22b We lost some functionality there, for instance; we should not proceed to configure the DB transport if the DB url is not valid. That should be the first check Also, not sure why you deleted the utils function to check DB configuration.. what's the point of that? I'm also not sure about the try/catch on Database constructor (although i've kept it)... If there is an error being Throw doesn't that break the server startup? We should be able to use the node without DB

We should probably return null if we catch an error (instead on throwing a new Error)
and update the check on index:

const dbconn: Database = await new Database(config.dbConfig)
if (!dbconn || !hasValidDBConfiguration(config.dbConfig)) {
...
config.hasIndexer = false

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.

Database: Move from typesense to ElasticSearch
4 participants