SpaceDB is a space data transmission and storage application that leverages code generated by the SpaceDataStandards.org project. It utilizes Google Flatbuffers as a serialization format, providing high-performance, memory-efficient, and cross-platform serialization essential for space operations.
Specifies the environment in which the application is running.
development
(default)test
production
Specifies the database client to be used by Knex.js.
better-sqlite3
(default)pg
(PostgreSQL)mysql
mysql2
sqlite3
- Any other supported Knex client
Specifies the filename for the SQLite database. Only used when DB_CLIENT
is set to better-sqlite3
or sqlite3
.
space-db
(default)- Any valid filename
Specifies the host of the database.
localhost
(default)- Any valid hostname or IP address
Specifies the username to connect to the database.
root
(default)- Any valid database username
Specifies the password to connect to the database.
- `` (default, empty string)
- Any valid database password
Specifies the name of the database.
spaceaware
(default)- Any valid database name
To run the tests for this project, you'll need to have Docker and Docker Compose installed on your system. Follow the instructions below to set up your environment and run the tests.
-
Docker: Docker is a platform that enables you to create, deploy, and run applications in containers. Install Docker by following the instructions for your operating system:
-
Docker Compose: Docker Compose is a tool for defining and running multi-container Docker applications. Install Docker Compose by following the instructions for your operating system:
- Docker Compose is included with Docker Desktop for Windows and Mac.
- For Linux, follow the installation instructions here.
First, clone the repository to your local machine:
git clone <https://github.com/your-repo/your-project.git>
cd your-project
Install the required Node.js dependencies using npm:
npm install
The tests are configured to use a Docker container for MySQL. The test setup will automatically start and stop the Docker container as needed.
To run the tests, use the following command:
npm test
This command will:
- Start a MySQL Docker container using Docker Compose.
- Run the test suite.
- Tear down the Docker container after the tests complete.
The Docker Compose configuration for the MySQL container is defined in test/docker-compose.yml
:
version: '3.1'
services:
mysqldb:
build: .
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: ""
MYSQL_DATABASE: "testdb"
The test/Dockerfile
sets up the MySQL container:
# Dockerfile for MySQL
FROM mysql:latest
ENV MYSQL_ROOT_PASSWORD=
ENV MYSQL_DATABASE=testdb
EXPOSE 3306
If you need to run the tests manually, you can start the MySQL container and then run the tests:
-
Start the MySQL container:
docker-compose -f test/docker-compose.yml up -d
-
Run the tests:
npm test
-
Tear down the MySQL container after the tests complete:
docker-compose -f test/docker-compose.yml down ```sh
This project is licensed under the terms of the license file included in this repository.