arangodb s3 bucket name compatibility (#3588)

* Update arangodb_store.go

* update readme, properly escape queries, add name patching

* use underscore

* use underscore

* better comment

* fix readme

Co-authored-by: a <a@a.a>
This commit is contained in:
gfx
2022-09-09 11:43:42 -05:00
committed by GitHub
parent 10d545060f
commit 48db56ddad
3 changed files with 58 additions and 7 deletions

View File

@@ -66,8 +66,8 @@ func (store *ArangodbStore) Initialize(configuration util.Configuration, prefix
}
func (store *ArangodbStore) connection(uris []string, user string, pass string, insecure bool) (err error) {
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
ctx, cn := context.WithTimeout(context.Background(), 10*time.Second)
defer cn()
store.connect, err = http.NewConnection(http.ConnectionConfig{
Endpoints: uris,
TLSConfig: &tls.Config{
@@ -274,10 +274,10 @@ func (store *ArangodbStore) DeleteFolderChildren(ctx context.Context, fullpath u
for d in %s
filter starts_with(d.directory, "%s/") || d.directory == "%s"
remove d._key in %s`,
targetCollection.Name(),
"`"+targetCollection.Name()+"`",
strings.Join(strings.Split(string(fullpath), "/"), ","),
string(fullpath),
targetCollection.Name(),
"`"+targetCollection.Name()+"`",
)
cur, err := store.database.Query(ctx, query, nil)
if err != nil {
@@ -296,7 +296,7 @@ func (store *ArangodbStore) ListDirectoryPrefixedEntries(ctx context.Context, di
if err != nil {
return lastFileName, err
}
query := "for d in " + targetCollection.Name()
query := "for d in " + "`" + targetCollection.Name() + "`"
if includeStartFile {
query = query + " filter d.name >= \"" + startFileName + "\" "
} else {