Skip to content

Precision-Marks/airsoft_database

Repository files navigation

Airsoft Database for Airsoft Spotter Application

This is a database of airsoft guns used in the AIRSOFT SPOTTER application.

Ask DeepWiki

Report Incorrect Data / Request to Add a New Airsoft Gun

Open the following link: https://github.com/Precision-Marks/airsoft_database/issues/new/choose

Environments required

Node.js: v20 (Tested by v20.8.1) npm >= 10.1.0

Run npm install to install required packages.

Test/Verify CSV database source files

npm run test-database

Create binary database

sh build-databases.sh

Output formats and options

  • By default, both Realm and SQLite databases are generated.
  • You can specify the format with --format:
    • realm: generate only Realm database
    • sqlite: generate only SQLite database
    • all: generate both (default)

Outputs:

  • Realm: db/realm/catalog_data.realm and db/realm/catalog_data.realm.commitid
  • SQLite: db/sqlite/catalog_data.db and db/sqlite/catalog_data.db.commitid
  • Extracted SQLite DDL: db/sqlite/catalog_schema.sql

Examples:

  • Generate both:
    • sh build-databases.sh
  • Generate only SQLite (direct call):
    • npx ts-node src/index.ts --format sqlite -c <commit>

Contribution

To add/modify the gun database edit ./source_data/GunCatalog.csv

To add/modify manufacturer database, edit ./source_data/ManufacturerCatalog.csv

Please refer to the Data Schema section below for details on the required fields and format for these CSV files.

If you add a manufacturer, you should also add "generic" gun data in GunCatalog.csv. The "generic" data has ID < 10000 and starts from 0,25,50,75. And also set src/models/GunIdRange.ts. Gun ID for a manufacturer starts from n x 1000 to n x 1000 + 999.

Data Schema

Details about the structure and fields of the CSV source files can be found in the following documents:

VsCode extensions recommended

  • Rainbow CSV
  • vscode-input-sequence: To set sequential id numbers

About

Airsoft database for Airsoft Spotter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •