2

Description

In MySQL world, one can create an SQL file and execute it from the command line.

mysql -h hostname -u user database < path/to/sqlfile.sql

This is especially useful for test data.

I've checked the Arangodb documentation and the best I can see for putting in test data is this from the cookbook

https://docs.arangodb.com/3.2/Cookbook/AQL/CreatingTestData.html

Please is it possible to write an aql file and execute it in the command line like with MySQL?

MRainzo
  • 3,800
  • 2
  • 16
  • 25

1 Answers1

1

In contrast to mysql SQL which contains DML and DDL language elements, AQL by definition only contains DML statements. Therefore "executing AQL" is most probably not what suits your needs.

The arangosh can be used to read files from the filesystem, which you then could use to send AQL queries or creating collections and indices.

If you want a reproduceable state, you could create a set of data that you like maybe by creating a CSV to read using arangoimp, create indices and so on, then dump your database using arangodump and for setting up your SUT use arangorestore.

There are tools by community members, Migrant Verde and ArangoMiGO that enable you to do schema evolution etc which may be of interest for that purpose too.

dothebart
  • 5,972
  • 16
  • 40