Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== arcadedb {{arcadedb}} is a CHICKEN Scheme egg module providing a driver or REPL for the [[https://arcadedb.com|'''ArcadeDB''']] database. [[toc:]] == About '''ArcadeDB''' '''ArcadeDB''' is an open-source multi-model NoSQL database providing the models: * Key-Value, * Document, * Graph, * Time Series, * Vector, while supporting a range of data query languages, such as: * [[https://docs.arcadedb.com/#SQL|SQL]] (dialect), * [[https://opencypher.org/resources/|Cypher]], * [[https://tinkerpop.apache.org/docs/current/|Gremlin]], * [[https://graphql.org/|GraphQL]], * [[https://www.mongodb.com/docs/manual/|MQL]] (Mongo) as well as providing a JSON / REST-like / HTTP API. === SQL The native query language of '''ArcadeDB''' is a dialect of SQL, closely related to ''OrientDB'''s OSQL, which supports the [[https://www.geeksforgeeks.org/sql-ddl-dql-dml-dcl-tcl-commands/|SQL command categories]]: * '''DDL''' - Data Definition Language, via {{CREATE}}, {{DROP}}, {{ALTER}}, {{TRUNCATE}} of {{TYPE}}s and {{PROPERTY}}s * '''DQL''' - Data Query Language, via {{SELECT}}, {{TRAVERSE}}, {{MATCH}} * '''DML''' - Data Manipulation Language, via {{INSERT}}, {{UPDATE}}, {{DROP}}, {{CREATE VERTEX}}, {{CREATE EDGE}}, {{MOVE VERTEX}} * '''TCL''' - Transaction Control Language, via {{BEGIN}}, {{COMMIT}}, {{ROLLBACK}} for the remaining category holds: * '''DCL''' - Data Control Language, does not apply due to only [[https://docs.arcadedb.com/#Security|server level users]] == About {{arcadedb}} The {{arcadedb}} module implements a driver and console for '''ArcadeDB''' in ''CHICKEN Scheme'' with the functionality: * [[#server-connection|Server Connection]] * [[#server-information|Server Information]] * [[#server-databases|Server Databases]] * [[#database-management|Database Management]] * [[#databse-connection|Database Connection]] * [[#database-interaction|Database Interaction]] * [[#database-macros|Database Macros]] === Runtime Dependencies Naturally, {{arcadedb}} requires a running remote or local '''ArcadeDB''' server: * [[https://github.com/ArcadeData/arcadedb/releases/latest|ArcadeDB]] which in turn requires a ''Java'' distribution in version 17, i.e. ''OpenJDK'' (headless). A local server setup is described below. Furthermore, the {{arcadedb}} module requires {{wget}} for the HTTP requests: * [[https://www.gnu.org/software/wget/|wget]] during runtime, and imports the {{medea}} egg to decode JSON: * [[https://wiki.call-cc.org/eggref/5/medea|medea]] == Local Server Setup A local '''ArcadeDB''' server can be set up via [[#install|install]] or [[#container|container]]. === Install *# Download package: [[https://github.com/ArcadeData/arcadedb/releases/latest|'''ArcadeDB''' package]] *# Extract package: {{tar -xf arcadedb-latest.tar.gz}} *# Start server: {{ARCADEDB_HOME=/path/to/arcadedb/ bin/server.sh -Darcadedb.server.rootPassword=mypassword &}} *# Exit server: {{kill `cat bin/arcade.pid`}} === Container *# Install [[https://www.docker.com/|Docker]] or [[https://podman.io/|Podman]] (just replace {{docker}} with {{podman}} below) *# Download container: {{docker pull arcadedata/arcadedb}} *# Start container: {{docker run --rm -d -p 2480:2480 -e JAVA_OPTS="-Darcadedb.server.rootPassword=mypassword --name arcadedb0 arcadedata/arcadedb}} *# Stop container: {{docker stop arcadedb0}} == Procedures === Help Message ==== a-help <procedure>(a-help)</procedure> Returns '''void''', prints help about using the {{arcadedb}} module. === Server Connection ==== a-server <procedure>(a-server user pass host . port)</procedure> Returns '''alist''' with single entry if connection to server using '''string'''s {{user}}, {{pass}}, {{host}}, and optionally '''number''' {{port}}, succeded; returns {{#f}} if a server error occurs or no response is received. ==== a-clear <procedure>(a-clear)</procedure> Returns {{true}} after clearing internal parameters {{server}} and {{secret}}. === Server Information ==== a-ready? <procedure>(a-ready?)</procedure> Returns '''boolean''' answering if server is ready. ==== a-version <procedure>(a-version)</procedure> Returns '''string''' version number of the server; returns {{#f}} if a server error occurs or no response is received. === Server Databases ==== a-list <procedure>(a-list)</procedure> Returns '''list''' of '''symbol'''s holding available databases of the server; returns {{#f}} if a server error occurs or no response is received. ==== a-exist? <procedure>(a-exist? db)</procedure> Returns '''boolean''' answering if database '''symbol''' {{db}} exists on the server. === Database Management ==== a-new <procedure>(a-new db)</procedure> Returns '''boolean''' that is true if creating new database '''symbol''' {{db}} succeded; returns {{#f}} if a server error occurs or no response is received. This command can only be executed by the root or admin user. ==== a-delete <procedure>(a-delete db)</procedure> Returns '''boolean''' that is true if deleting database '''symbol''' {{db}} osucceded; returns {{#f}} if a server error occurs or no response is received. This command can only be executed by the root or admin user. === Database Connection ==== a-use <procedure>(a-use db)</procedure> Returns '''boolean''' that is true if database '''symbol''' {{db}} is connected; returns {{#f}} if a server error occurs or no response is received. ==== a-using <procedure>(a-using)</procedure> Returns '''symbol''' naming current database; returns {{#f}} if no database is connected. === Database Interaction ==== a-query <procedure>(a-query db lang query)</procedure> Returns '''list''' holding the result of '''string''' {{query}} in language '''symbol''' {{lang}} on current database; returns {{#f}} if a server error occurs or no response is received. Valid {{lang}} '''symbols''' are: {{sql}}, {{sqlscript}}, {{cypher}}, {{gremlin}}, {{graphql}}, {{mongo}}. ==== a-command <procedure>(a-command db lang cmd)</procedure> Returns '''list''' holding the result of '''string''' {{cmd}} in language '''symbol''' {{lang}} to current database; returns {{#f}} if a server error occurs or no response is received. Valid {{lang}} '''symbols''' are: {{sql}}, {{sqlscript}}, {{cypher}}, {{gremlin}}, {{graphql}}, {{mongo}}. === Database Macros ==== a-config <procedure>(a-config)</procedure> Returns '''alist''' of type descriptions for current database infos; returns {{#f}} if a server error occurs or no response is received. ==== a-schema <procedure>(a-schema)</procedure> Returns '''alist''' of type descriptions for current database schema; returns {{#f}} if a server error occurs or no response is received. This function emulates the SQL {{DESCRIBE}} statement. ==== a-script <procedure>(a-script path)</procedure> Returns '''list''' holding the result of the last statement of SQL script in '''string''' {{path}} executed on current database; returns {{#f}} if a server error occurs or no response is received. A SQL script file has to have the file extension {{.sql}}. ==== a-upload <procedure>(a-upload path type)</procedure> Returns '''boolean''' that is true if uploading ''JSON'' file at '''string''' {{path}} into current database as '''symbol''' {{type}} succeded; returns {{#f}} if a server error occurs or no response is received. A JSON script file has to have the file extension {{.json}}. ==== a-ingest <procedure>(a-ingest url)</procedure> '''boolean''' that is true if importing from '''string''' {{url}} into current database succeded; returns {{#f}} if a server error occurs or no response is received. This function can be a minimalistic ETL (Extract-Transform-Load) tool: If one needs to import data from another database with a HTTP API and the query can be encoded ([[https://docs.arcadedb.com/#HTTP-API|as for '''ArcadeDB''']]) in the URL, the extraction and transformation is performed in the remote query, while the loading corresponds to the import of the query result. The supported formats are [[https://docs.arcadedb.com/#Importer|OrientDB, Neo4J, GraphML, GraphSON, XML, CSV, JSON, RDF]]. ==== a-jaccard <procedure>(a-jaccard type x y)</procedure> Returns '''flonum''' being the [[https://en.wikipedia.org/wiki/Jaccard_index|Jaccard similarity index]], given a '''symbol''' {{type}} and two '''symbol''' arguments {{x}} and {{y}}. ==== a-backup <procedure>(a-backup)</procedure> Returns '''boolean''' that is true if backing-up current database succeded. ==== a-stats <procedure>(a-stats)</procedure> Returns '''list'''-of-'''alist'''s reporting statistics on current database; returns {{#f}} if a server error occurs or no response is received. ==== a-health <procedure>(a-health)</procedure> Returns '''list'''-of-'''alist'''s reporting health of current database; returns {{#f}} if a server error occurs or no response is received. ==== a-repair <procedure>(a-repair)</procedure> Returns '''boolean''' that is true if automatic repair succeeded. ==== a-metadata <procedure>(a-metadata id key . value)</procedure> Returns the value of the custom attribute with '''symbol''' {{key}} of type or property '''symbol''' {{key}}, if {{value}} is not passed. Returns '''boolean''' that is true if setting custom attribute '''symbol''' {{key}} with '''string''' or '''number''' {{value}} succeded. ==== a-comment <procedure>(a-comment)</procedure> <procedure>(a-comment . msg)</procedure> Returns '''string''' being database comment of current database, if '''string''' {{msg}} is not passed. Returns '''boolean''' that is true if setting database comment '''string''' {{msg}} succeded. This function emulates the SQL {{COMMENT ON DATABASE}} statement, by creating a type {{sys}} and upserting or reading the first {{comment}} property. == Changelog * {{0.1}} [[https://github.com/gramian/chicken-arcadedb|Initial Release]] (2022-11-15) * {{0.2}} [[https://github.com/gramian/chicken-arcadedb|Minor Update]] (2022-11-16) * {{0.3}} [[https://github.com/gramian/chicken-arcadedb|Major Update]] (2022-12-09) * {{0.4}} [[https://github.com/gramian/chicken-arcadedb|Minor Update]] (2023-01-16) * {{0.5}} [[https://github.com/gramian/chicken-arcadedb|Major Update]] (2023-03-01) * {{0.6}} [[https://github.com/gramian/chicken-arcadedb|Major Update]] (2023-05-05) * {{0.7}} [[https://github.com/gramian/chicken-arcadedb|Minor Update]] (2023-09-29) * {{0.8}} [[https://github.com/gramian/chicken-arcadedb|Major Update]] (2024-03-12) == License Copyright (c) 2022 ''Christian Himpe'' under [[https://spdx.org/licenses/zlib-acknowledgement.html|zlib-acknowledgement]] license.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you subtract 20 from 22?