Skip to content

Conversation

@0xdps
Copy link
Owner

@0xdps 0xdps commented Nov 18, 2025

No description provided.

0xdps added 20 commits November 18, 2025 08:25
- Update workflow to use homebrew-packages repository
- Update all documentation with new tap name
- Users can now: brew tap 0xdps/packages && brew install fakestack
- Prepares tap for future tools beyond fakestack
- Add MSSQL, MariaDB, and CockroachDB database type constants
- Add Microsoft SQL Server driver (github.com/denisenkom/go-mssqldb)
- Implement connection strings for new databases
- Add MSSQL IDENTITY autoincrement syntax
- Add MSSQL NEWID() for random value selection
- MariaDB uses MySQL driver (drop-in compatible)
- CockroachDB uses PostgreSQL driver
- Create manual test workflow for all 6 databases (workflow_dispatch)
- Update documentation with new database configurations
- Add Docker setup examples for MSSQL and CockroachDB

Total supported databases: SQLite, MySQL, PostgreSQL, MariaDB, MSSQL, CockroachDB
- Implemented a bash script to generate database schemas for SQLite, MySQL, PostgreSQL, MariaDB, MS SQL Server, and CockroachDB.
- Added user prompts for database credentials, schema templates, and output filename.
- Supported schema generation for various templates including Users, Employees, Products, Orders, Customers, Blog Posts, Inventory, Transactions, Students, and Tasks.
- Output schema is formatted as JSON and saved to a specified file.
- Included instructions for creating tables and populating data using the generated schema.
- Introduced a centralized test schema in `test-schema.json` to standardize database integration tests across multiple databases.
- Created a comprehensive README in `.github/workflows/README.md` detailing the test schema, its structure, and guidelines for adding new generators.
- Ensured validation of generator fields to maintain consistency and reduce duplication in test setups.
- Increase locale column length from 10 to 20 characters (fixes MySQL/MariaDB data truncation)
- Combine -c and -p flags into single command (fixes table creation issues)
- Fixes errors in PostgreSQL, CockroachDB, and SQLite tests

Issues fixed:
- MySQL/MariaDB: Data too long for column 'locale' at row 1
- PostgreSQL/CockroachDB: Relation does not exist errors
- SQLite: No such table errors after creation
@0xdps 0xdps requested a review from Copilot November 18, 2025 09:45
@0xdps 0xdps merged commit cc25b4f into trunk Nov 18, 2025
44 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR merges the develop branch to trunk, introducing significant feature additions including interactive schema generation, expanded database support (adding MariaDB, MS SQL Server, and CockroachDB), 80+ new data generators, a template generator for custom data patterns, and comprehensive testing infrastructure.

Key changes:

  • Added interactive schema generator with 10 pre-built templates accessible via -g flag
  • Extended database support from 3 to 6 systems (SQLite, MySQL, PostgreSQL, MariaDB, MSSQL, CockroachDB)
  • Expanded from 36 to 116+ data generators covering financial, localization, products, media, animals, food, vehicles, and more
  • Introduced template generator for custom data patterns with modifiers
  • Created centralized test schema and manual database testing workflow
  • Updated Homebrew tap from homebrew-fakestack to homebrew-packages

Reviewed Changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/uninstall.sh New uninstall script for removing fakestack from npm, pip, and Homebrew
scripts/generate-schema.sh New bash implementation of interactive schema generator with 10 templates
golang/templates.go New Go implementation of interactive schema generator (542 lines)
golang/schema.go Added database type constants for MSSQL, MariaDB, and CockroachDB
golang/main.go Added -g/--generate CLI flags for interactive schema generation
golang/generator.go Added 80+ generators and template parser with modifier support
golang/database.go Added MSSQL driver and database-specific SQL syntax handling
go.mod Updated Go version and added MSSQL dependencies
go.sum Added dependency checksums for new packages
docs/requirements.txt Added mike for documentation versioning
docs/mkdocs.yml Configured version selector for documentation
docs/index.md Updated Homebrew installation instructions
docs/getting-started.md Updated Homebrew tap reference
docs/databases.md Added documentation for MariaDB, MSSQL, and CockroachDB
docs/api-reference.md Updated Homebrew installation command
docs/.readthedocs.yaml Added mike deployment configuration
README.md Updated features list, added template examples, updated Homebrew instructions
CHANGELOG.md Comprehensive changelog with all new features and fixes
.github/workflows/test-schema.json New centralized test schema with 84 columns covering all generators
.github/workflows/test-databases.yml New manual testing workflow for all 6 databases
.github/workflows/test-build.yml Added tag trigger for version builds
.github/workflows/publish.yml Updated Homebrew tap repository reference
.github/workflows/README.md Documentation for centralized test schema approach

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

end := strings.Index(result[start:], "}}")
if end == -1{
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after end == -1 condition. The condition if end == -1{ should have a space before the opening brace for consistency with Go formatting standards.

Fix: if end == -1 {

Suggested change
if end == -1{
if end == -1 {

Copilot uses AI. Check for mistakes.
jq -s '.[0] * {"database": .[1]}' \
.github/workflows/test-schema.json \
<(echo '{
"dbtype": "mysql",
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MariaDB test job uses "dbtype": "mysql" instead of "dbtype": "mariadb". While MariaDB is MySQL-compatible and uses the same driver, the schema should specify "mariadb" to properly test the MariaDB-specific code path defined in golang/database.go line 50 and 66.

Change to:

"dbtype": "mariadb",
Suggested change
"dbtype": "mysql",
"dbtype": "mariadb",

Copilot uses AI. Check for mistakes.
git add Formula/fakestack.rb
git commit -m "chore: update formula to ${GITHUB_REF#refs/tags/}"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/0xdps/homebrew-fakestack.git main || echo "⚠️ Formula update failed, manual update needed"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/0xdps/homebrew-packages.git trunk || echo "⚠️ Formula update failed, manual update needed"
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git push command references trunk branch, but the original repository structure used main. This inconsistency could cause the Homebrew formula update to fail if the target repository doesn't have a trunk branch.

Verify that the homebrew-packages repository uses trunk as its default branch, or update this to match the actual branch name used in that repository.

Suggested change
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/0xdps/homebrew-packages.git trunk || echo "⚠️ Formula update failed, manual update needed"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/0xdps/homebrew-packages.git main || echo "⚠️ Formula update failed, manual update needed"

Copilot uses AI. Check for mistakes.
jq -s '.[0] * {"database": .[1]}' \
.github/workflows/test-schema.json \
<(echo '{
"dbtype": "postgres",
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CockroachDB test job uses "dbtype": "postgres" instead of "dbtype": "cockroachdb". While CockroachDB is PostgreSQL-compatible and uses the same driver, the schema should specify "cockroachdb" to properly test the CockroachDB-specific code path defined in golang/database.go line 52 and 69.

Change to:

"dbtype": "cockroachdb",
Suggested change
"dbtype": "postgres",
"dbtype": "cockroachdb",

Copilot uses AI. Check for mistakes.
.github/workflows/test-schema.json \
<(echo '{
"dbtype": "sqlite",
"host": "test.db"
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SQLite database configuration uses "host": "test.db" which is incorrect. SQLite uses the "database" field for the file path, not "host". According to the schema structure shown in other files (e.g., scripts/generate-schema.sh line 62), SQLite should use:

{
  "dbtype": "sqlite",
  "database": "test.db"
}

The host field should be removed as it's not used for SQLite connections.

Suggested change
"host": "test.db"
"database": "test.db"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants