Last active
April 2, 2023 10:12
-
-
Save dacr/fd4a49035e71381320b5c889f851adc8 to your computer and use it in GitHub Desktop.
playing with arangodb using scarango client library / published by https://github.com/dacr/code-examples-manager #8333f36c-d6c2-4a83-897c-44ae8da1fd5c/4581ddfd34d7d056b7ed138a373e7f45dee79b00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env amm | |
// summary : playing with arangodb using scarango client library | |
// keywords : arangodb, graphdb, scarango, @testable, | |
// publish : gist, corporate | |
// authors : David Crosson | |
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
// id : 8333f36c-d6c2-4a83-897c-44ae8da1fd5c | |
// created-on : 2021-03-05T09:25:00Z | |
// managed-by : https://github.com/dacr/code-examples-manager | |
// execution : scala ammonite script (http://ammonite.io/) - run as follow 'amm scriptname.sc' | |
//interp.repositories() ++= Seq(coursierapi.MavenRepository.of("http://oss.sonatype.org/content/repositories/releases")) | |
//import $ivy.`com.cornfluence:proteus_2.13:0.7.3` | |
import $ivy.`com.charlesahunt::proteus:0.7.3` | |
import cats.effect.IO | |
import com.charlesahunt.proteus.client._ | |
import com.charlesahunt.proteus.config.ProteusConfig | |
val cfg = ProteusConfig( | |
host = "127.0.0.1", | |
user = "root@example", | |
password = "password", | |
) | |
val arangoClient = new ArangoClient[IO](cfg) | |
val documentClient = new DocumentClient[IO](config = cfg, databaseName = "example") | |
//val databases = arangoClient.getDatabaseList | |
//databases.unsafeRunSync() match { | |
// case Left(err) => println(err) | |
// case Right(ok) => println(ok.toString) | |
//} | |
val docs = documentClient.getAllDocuments("sample") | |
docs.unsafeRunSync() match { | |
case Left(err) => println(err) | |
case Right(ok) => println(ok.toString) | |
} | |
//val graphClient = new GraphClient[IO](config = cfg, graphName = "worldCountry") | |
//arangoClient. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment