Getting Started with Fakestack¶
This guide will help you get started with Fakestack in just a few minutes.
Installation¶
Choose your preferred installation method:
Python (pip)¶
Node.js (npm)¶
Homebrew (macOS/Linux)¶
Direct Binary Download¶
Download pre-built binaries from GitHub Releases.
Your First Database¶
Step 1: Download Example Schema¶
This creates a schema.json file with an example database structure.
Step 2: Generate the Database¶
This will: 1. Create database tables based on the schema 2. Populate them with realistic fake data
Step 3: Verify the Data¶
# For SQLite (default)
sqlite3 test.db "SELECT * FROM users LIMIT 5;"
# For MySQL
mysql -u root -p testdb -e "SELECT * FROM users LIMIT 5;"
# For PostgreSQL
psql -U postgres -d testdb -c "SELECT * FROM users LIMIT 5;"
Using in Your Code¶
Python¶
from fakestack import fakestack
# Generate database
exit_code = fakestack(['-c', '-p', '-f', 'schema.json'])
if exit_code == 0:
print("Database generated successfully!")
Node.js / TypeScript¶
import { fakestack } from 'fakestack';
// Generate database
const exitCode = await fakestack(['-c', '-p', '-f', 'schema.json']);
if (exitCode === 0) {
console.log('Database generated successfully!');
}
Next Steps¶
- Schema Reference - Learn how to create custom schemas
- Data Generators - Explore all available data generators
- Database Support - Configure different databases
- Examples - See real-world examples
Common Commands¶
# Download example schema
fakestack -d .
# Create tables only
fakestack -c -f schema.json
# Populate data only (tables must exist)
fakestack -p -f schema.json
# Create and populate in one command
fakestack -c -p -f schema.json
# Get help
fakestack -h
Troubleshooting¶
Binary Not Found¶
If you get a "binary not found" error, make sure you've installed fakestack correctly:
# Python
pip install --upgrade fakestack
# Node.js
npm install --save fakestack
# Homebrew
brew upgrade 0xdps/fakestack
Permission Denied (Unix/macOS/Linux)¶
The binary might not have execute permissions:
Database Connection Errors¶
Verify your database configuration in the schema file: - Check credentials (username, password) - Verify host and port - Ensure database exists - Check network connectivity
For more help, see Troubleshooting.