@famgia/omnify-atlas 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -0
- package/package.json +5 -4
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# @famgia/omnify-atlas
|
|
2
|
+
|
|
3
|
+
Atlas CLI integration for Omnify schemas. Generate HCL schemas and compute database diffs.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @famgia/omnify-atlas
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
|
|
13
|
+
[Atlas CLI](https://atlasgo.io/getting-started/) must be installed:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# macOS
|
|
17
|
+
brew install ariga/tap/atlas
|
|
18
|
+
|
|
19
|
+
# Linux
|
|
20
|
+
curl -sSf https://atlasgo.sh | sh
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import {
|
|
27
|
+
generateHCL,
|
|
28
|
+
runAtlasDiff,
|
|
29
|
+
AtlasRunner,
|
|
30
|
+
HCLGenerator
|
|
31
|
+
} from '@famgia/omnify-atlas';
|
|
32
|
+
|
|
33
|
+
// Generate Atlas HCL from schemas
|
|
34
|
+
const hcl = generateHCL(schemas, {
|
|
35
|
+
dialect: 'mysql',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Run Atlas diff
|
|
39
|
+
const diff = await runAtlasDiff({
|
|
40
|
+
from: 'file://schema.hcl',
|
|
41
|
+
to: 'mysql://user:pass@localhost:3306/db',
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- HCL schema generation from Omnify schemas
|
|
48
|
+
- Atlas CLI wrapper for diffing
|
|
49
|
+
- Support for MySQL, PostgreSQL, SQLite
|
|
50
|
+
- Lock file management
|
|
51
|
+
- Migration preview
|
|
52
|
+
|
|
53
|
+
## Generated HCL
|
|
54
|
+
|
|
55
|
+
```hcl
|
|
56
|
+
table "users" {
|
|
57
|
+
schema = schema.main
|
|
58
|
+
|
|
59
|
+
column "id" {
|
|
60
|
+
type = bigint
|
|
61
|
+
auto_increment = true
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
column "email" {
|
|
65
|
+
type = varchar(255)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
primary_key {
|
|
69
|
+
columns = [column.id]
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
index "users_email_unique" {
|
|
73
|
+
columns = [column.email]
|
|
74
|
+
unique = true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Related Packages
|
|
80
|
+
|
|
81
|
+
- [@famgia/omnify-core](https://www.npmjs.com/package/@famgia/omnify-core) - Core engine
|
|
82
|
+
- [@famgia/omnify-cli](https://www.npmjs.com/package/@famgia/omnify-cli) - CLI tool
|
|
83
|
+
- [@famgia/omnify-laravel](https://www.npmjs.com/package/@famgia/omnify-laravel) - Laravel generator
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@famgia/omnify-atlas",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Atlas CLI integration for omnify-schema",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
|
-
"dist"
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
18
19
|
],
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"execa": "^9.6.1",
|
|
21
|
-
"@famgia/omnify-core": "0.0.
|
|
22
|
-
"@famgia/omnify-types": "0.0.
|
|
22
|
+
"@famgia/omnify-core": "0.0.3",
|
|
23
|
+
"@famgia/omnify-types": "0.0.3"
|
|
23
24
|
},
|
|
24
25
|
"scripts": {
|
|
25
26
|
"build": "tsup",
|