Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rotemtam/splt
splits large https://github.com/ariga/atlas schemas
https://github.com/rotemtam/splt
atlas hcl schema
Last synced: 23 days ago
JSON representation
splits large https://github.com/ariga/atlas schemas
- Host: GitHub
- URL: https://github.com/rotemtam/splt
- Owner: rotemtam
- License: apache-2.0
- Created: 2024-09-26T08:09:45.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2024-10-17T13:38:25.000Z (about 1 month ago)
- Last Synced: 2024-10-19T19:19:29.893Z (about 1 month ago)
- Topics: atlas, hcl, schema
- Language: Go
- Homepage: https://atlasgo.io
- Size: 21.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# splt
> Note: This experimental tool is not officially supported by Ariga or Atlas and is provided as-is.
A small command tool to split an Atlas HCL schema file into multiple files.
Accepts input schema via a file or stdin and writes the split files to a directory.
Supported strategies:
- `schema`: split by schema: each schema is written to a separate file.
- `block`: split by block: each block type is written to a separate file.## Quickstart
Install:
```bash
go install github.com/rotemtam/splt/cmd/splt
```Split a file:
```bash
# split by schema
atlas schema inspect --url '' | splt --output=./out --strategy=schema
```Verify output is correct:
```bash
atlas schema diff --dev-url docker://postgres/16/dev --from --to file://out/
````Output:
```
Schemas are synced, no changes to be made.
```## Help
```
Usage: splt --output=./path/to/dir [flags]Flags:
-h, --help Show context-sensitive help.
-i, --input=STRING Input HCL file to split.
-o, --output=./path/to/dir Destination directory to write the split files.
--strategy="schema" Splitting strategy options:schema,block
```