Skip to content

Commit

Permalink
Feat/rotated (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlangzi authored Mar 6, 2024
1 parent c9f8403 commit eb33d0d
Show file tree
Hide file tree
Showing 5 changed files with 508 additions and 71 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- added detail logs on migration (#17)
- added rotated table migration support (#17)
- added `Rotate` method for rotate service (#18)

### Fixed
- fixed rollback issue on `Transaction` (#17)
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,18 @@ CREATE TABLE IF NOT EXISTS monthly_logs<rotate> (

see more [examples](./migrate/migrator_test.go?L360)

if rotate is enabled for any table, rotate should be executed periodically in a cron job. so rotated tables will be created periodically.
```
├── db
│   └── monthly
│   ├── members.sql
│   └── weekly
│   ├── orders.sql
│   └── daily
│   ├── logs.sql
```
see more [examples](./migrate/migrator_test.go?L581)

## Security: SQL Injection
SQLE uses the database/sql‘s argument placeholders to build parameterized SQL statement, which will automatically escape arguments to avoid SQL injection. eg if it is PostgreSQL, please apply [UsePostgres](use.go#L5) on SQLBuilder or change [DefaultSQLQuote](sqlbuilder.go?L16) and [DefaultSQLParameterize](sqlbuilder.go?L17) to update parameterization options.

Expand Down
Loading

0 comments on commit eb33d0d

Please sign in to comment.