Add SQLite support for local development#79
Closed
TaprootFreak wants to merge 8 commits into
Closed
Conversation
- Add sqlite3 dependency - Configure environment-based database selection (SQLite for local, MSSQL for dev/prod) - Update entity column types for SQLite compatibility - Add testDB directory to gitignore
Contributor
Author
|
Do not use Squash |
- Skip Lightning WebSocket connections in loc environment - Replace MSSQL-specific length:'MAX' with type:'text' for SQLite compat - Skip Alchemy webhook init when auth token is not configured - Skip EVM payment webhook setup when network is not configured
…te-db # Conflicts: # package-lock.json # package.json
- Skip CitreaClient wallet creation when EVM_WALLET_SEED is not set - Replace nvarchar(max) with text type in MonitoringEvmBalanceEntity
Use explicit environment check instead of missing config values to ensure misconfigurations in dev/prd fail loudly at startup.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds SQLite database support for local development while maintaining MSSQL for dev/prod environments.
Changes
Database Configuration: Environment-based database selection
ENVIRONMENT=loc→ SQLite (local development)ENVIRONMENT=dev|prd→ MSSQL (existing production setup)Dependencies: Added
sqlite3package as devDependency (not installed in production)Entity Updates: Updated column type definitions for cross-database compatibility
length: 'MAX'/nvarchar(max)→type: 'text'for SQLite compatibilitydatetime2→datetimefor SQLite compatibilitytype: 'float'for decimal numbersSQL_SYNCHRONIZE=falseprevents schema changes, runtime queries are unaffectedGraceful degradation for local environment (all guarded by
Environment.LOC):Gitignore: Added
testDB/and SQLite database filesLocal Development Setup
API available at
http://localhost:3000/v1, Swagger athttp://localhost:3000/swagger.Production Safety
Environment.LOCchecksSQL_SYNCHRONIZE=falsein prd prevents any schema modificationssqlite3is a devDependency — not installed in production buildsTesting
Breaking Changes
None. Backward compatible, only affects local development when
ENVIRONMENT=loc.