You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project uses a simple platform-specific binary distribution approach:
6
+
7
+
1.**Platform Detection**: The package manager automatically installs only the compatible platform package based on your OS and architecture
8
+
2.**Direct Binary Access**: Each platform package directly provides the `sqld` binary through its `bin` field
9
+
3.**No Wrapper**: No JavaScript wrapper or bootstrap code - the platform packages directly expose the native `sqld` binary
10
+
11
+
### Automated Updates
12
+
13
+
The project automatically checks for new `libsql-server` releases daily using GitHub Actions:
14
+
15
+
1.**Daily Check**: Runs at 9 AM UTC to check for new releases from the [libsql GitHub repository](https://github.com/tursodatabase/libsql/releases?q=libsql-server-)
16
+
2.**Binary Extraction**: Downloads platform-specific tarballs and extracts the `sqld` binaries
17
+
3.**Testing**: Verifies that all binaries work correctly
18
+
4.**Publishing**: Automatically publishes new versions to npm
19
+
5.**Git Commit**: Commits the updated binaries to the repository
20
+
21
+
The project uses the following release artifacts for each platform:
-`tar` command (available on macOS/Linux by default)
33
+
- npm account with publishing permissions
34
+
35
+
### Scripts
36
+
37
+
```bash
38
+
# Check for new versions
39
+
npm run check-version
40
+
41
+
# Extract binaries from GitHub releases
42
+
npm run extract-binaries
43
+
44
+
# Build everything (check + extract)
45
+
npm run build
46
+
47
+
# Test all binaries
48
+
npm run test
49
+
```
50
+
51
+
### Versioning
52
+
53
+
Set the versions across all packages & update the root's dependency specs
54
+
55
+
```bash
56
+
$ npm version --ws --iwr 0.24.1-pre.2
57
+
```
58
+
59
+
> Note: `npm` will error because of the optional deps `"os"` & `"cpu"` definitions. You can safely ignore this error as the operation will still successfully update the `package.json
60
+
61
+
### Publishing
62
+
63
+
Setting a `--tag` may not be desired depending on if its a prerelease
64
+
65
+
```bash
66
+
$ npm publish --ws --iwr --tag latest --access public
67
+
```
68
+
69
+
### GitHub Actions
70
+
71
+
Two workflows are included:
72
+
73
+
1.**`auto-publish.yml`**: Runs daily and on pushes to main, automatically publishes new versions
74
+
2.**`test.yml`**: Manual testing workflow that builds but doesn't publish
75
+
76
+
To set up automated publishing, add these secrets to your GitHub repository:
77
+
78
+
-`NPM_TOKEN`: Your npm authentication token with publish permissions
A package wrapper for [libsql-server](https://github.com/tursodatabase/libsql) (`sqld`) with platform-specific binaries.
4
4
5
-
This package automatically downloads and publishes the latest `libsql-server` releases from the official Docker container, making them available as npm packages with platform-specific binaries.
5
+
This package automatically downloads and publishes the latest `libsql-server` releases from the [official GitHub releases](https://github.com/tursodatabase/libsql/releases?q=libsql-server-), making them available as npm packages with platform-specific binaries.
6
6
7
7
## Installation
8
8
9
9
```bash
10
+
# Locally install in a project
10
11
vlt install sqld
11
12
```
12
13
14
+
## Usage
15
+
16
+
```bash
17
+
# Start sqld server
18
+
vlx sqld --help
19
+
20
+
# Example: Start with a database file
21
+
vlx sqld --db-path ./my-database.db
22
+
```
23
+
24
+
### Binaries
25
+
13
26
The appropriate platform-specific binary will be automatically installed based on your system:
1.**Main Package (`sqld`)**: Contains the Node.js wrapper and CLI interface
87
-
2.**Platform Packages**: Contains the actual binaries for each platform:
88
-
-`@sqld/darwin-arm64`
89
-
-`@sqld/darwin-x64`
90
-
-`@sqld/linux-arm64`
91
-
-`@sqld/linux-x64`
92
-
93
-
The main package declares the platform packages as optional dependencies. When you install `sqld`, your package manager will only install the package that matches your current platform.
94
-
95
-
## Automated Updates
96
-
97
-
This project automatically checks for new `libsql-server` releases daily using GitHub Actions:
98
-
99
-
1.**Daily Check**: Runs at 9 AM UTC to check for new releases
100
-
2.**Binary Extraction**: Downloads the Docker container and extracts platform-specific binaries
101
-
3.**Testing**: Verifies that all binaries work correctly
102
-
4.**Publishing**: Automatically publishes new versions to `npmjs.com`
103
-
5.**Git Commit**: Commits the updated binaries to the repository
104
-
105
-
## Development
106
-
107
-
### Prerequisites
108
-
109
-
- Node.js 18+
110
-
-`vlt` (`npm i -g vlt`)
111
-
112
-
### Scripts
113
-
114
-
```bash
115
-
# Check for new versions
116
-
vlr check-version
117
-
118
-
# Extract binaries from Docker containers
119
-
vlr extract-binaries
120
-
121
-
# Build everything (check + extract)
122
-
vlr build
123
-
124
-
# Test all binaries
125
-
clr test
126
-
127
-
# Publish all packages to npm
128
-
vlr publish-all
129
-
```
130
-
131
-
### Manual Testing
132
-
133
-
You can test the build process manually:
134
-
135
-
```bash
136
-
# Install dependencies
137
-
vlt install
138
-
139
-
# Extract the latest binaries
140
-
vlr extract-binaries
141
-
142
-
# Test that everything works
143
-
vlr test
144
-
145
-
# Test the CLI
146
-
./bin/sqld --help
147
-
```
148
-
149
-
### GitHub Actions
150
-
151
-
Two workflows are included:
152
-
153
-
1.**`auto-publish.yml`**: Runs daily and on pushes to main, automatically publishes new versions
154
-
2.**`test.yml`**: Manual testing workflow that builds but doesn't publish
155
-
156
-
To set up automated publishing, add these secrets to your GitHub repository:
157
-
158
-
-`NPM_TOKEN`: Your npm authentication token with publish permissions
159
-
160
-
## Project Structure
161
-
162
-
```
163
-
sqld/
164
-
├── package.json # Main package configuration
165
-
├── lib/index.js # Node.js API
166
-
├── bin/sqld # CLI wrapper
167
-
├── scripts/
168
-
│ ├── check-version.js # Check for new releases
169
-
│ ├── extract-binaries.js # Extract binaries from Docker
170
-
│ ├── build.js # Build orchestration
171
-
│ ├── publish-all.js # Publish all packages
172
-
│ └── test.js # Test all binaries
173
-
├── packages/
174
-
│ ├── darwin-arm64/ # macOS ARM64 package
175
-
│ ├── darwin-x64/ # macOS x64 package
176
-
│ ├── linux-arm64/ # Linux ARM64 package
177
-
│ └── linux-x64/ # Linux x64 package
178
-
└── .github/workflows/ # GitHub Actions
179
-
```
180
-
181
44
## License
182
45
183
46
MIT
184
47
185
-
## Contributing
186
-
187
-
Contributions are welcome! Please feel free to submit a Pull Request.
188
-
189
48
## Related Projects
190
49
191
50
-[libsql](https://github.com/tursodatabase/libsql) - The original libSQL project
0 commit comments