Skip to content

feat(ArangoDB): Add basic support for ArangoDB#202

Open
enchantednatures wants to merge 6 commits into
kndndrj:masterfrom
enchantednatures:master
Open

feat(ArangoDB): Add basic support for ArangoDB#202
enchantednatures wants to merge 6 commits into
kndndrj:masterfrom
enchantednatures:master

Conversation

@enchantednatures
Copy link
Copy Markdown

This adds basic support for ArangoDB, a multi-modal Graph Database. This initial implementation phase supports primarily the dedicated query language: AQL and the json responses.

Copy link
Copy Markdown
Collaborator

@MattiasMTS MattiasMTS left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @enchantednatures! 😄 ✨ much appreciated, I learned a new database today 😋

Left some early comments on the adapter code - I'll take a second look on the integration tests. Very nice and appreciated the addition of integration test in the PR 👍

Comment thread dbee/adapters/arango.go

type Arango struct{}

func (p *Arango) Connect(rawUrl string) (core.Driver, error) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know too little about arangodb, but to me it feels like there is a lot happening in this method based on certain conditions that might be unknown to the user (i.e. implicit behaviour). Do you think we want to make these things a bit more explicit based on the rawUrl? i.e. choose beteween http, http2 and jwt based on ?connection_type='input' or something similar? 😄

Comment thread dbee/adapters/arango.go Outdated
if u.User != nil {
// Basic Authentication
username := u.User.Username()
password, _ := u.User.Password()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

will arangodb return error or panic if the password is empty? I'd say just add e.g.

password, ok = u.User.Password()
if !ok {
	return nil, fmt.Errorf("arango: password not set for user: %w", err)
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It is possible, albeit not recommended, to run Arango and not require a root password. I will add a test case to cover this scenario.

Comment thread dbee/adapters/arango.go
@@ -0,0 +1,64 @@
package adapters
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: should we call the files arangodb.go and arangodb_driver.go given this is the name of the driver?

Comment thread dbee/adapters/arango_driver.go Outdated
return "", nil, errors.New("arangoDriver is not initialized")
}

log.Print("Fetching list of databases")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I appreciate logging are nice but for now we don't have a good logging file structure yet - planning to add this. Ergo, could you remove the logging statements used in this file? Thanks ✨

Comment thread dbee/adapters/arango_driver.go Outdated
}

func (a *arangoDriver) ListDatabases() (current string, available []string, err error) {
if a == nil || a.c == nil {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this shouldn't be needed to check due to the nature of init. Could you elaborate more on when you see this error?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This goes for all the other method checks in this file.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'm not that familiar with golang. I was unsure if there was risk of a nil receiver here. I will remove.

Comment thread dbee/adapters/arango_driver.go
Comment thread dbee/adapters/arango_driver.go
Comment thread dbee/adapters/arango_driver.go
Comment thread dbee/adapters/arango_driver.go
return nil, fmt.Errorf("failed to list databases: %w", err)
}

structures := make([]*core.Structure, len(databases))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice clean! ✨

enchantednatures and others added 2 commits March 31, 2025 20:10
Co-authored-by: Mattias Sjödin <86059470+MattiasMTS@users.noreply.github.com>
feat(ArangoDB): add additional ArangoDB connection setup
@enchantednatures
Copy link
Copy Markdown
Author

@MattiasMTS thanks for taking the time to review! I've added a few changes, and applied your suggestions. Please take a look specifically at the latest changes in Connect I've added parsing options from the connection string query parameters.

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.

2 participants