Skip to content

Commit c5c0334

Browse files
committed
contributing
1 parent 719937b commit c5c0334

1 file changed

Lines changed: 18 additions & 25 deletions

File tree

CONTRIBUTING.md

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,37 +39,22 @@ The resulting executable will be in `target/release/sqlpage`.
3939

4040
### ODBC build modes
4141

42-
SQLPage supports three additive build modes for ODBC. Choose the mode via Cargo features:
43-
44-
- Dynamic ODBC (default):
45-
- Works on Linux, macOS and Windows (Windows has ODBC built-in).
46-
- Command:
47-
```bash
48-
cargo build # or: cargo build --features odbc-dynamic
49-
```
50-
- Static ODBC (Linux only):
51-
- Statically links the ODBC driver manager; simplifies distribution.
52-
- Command:
53-
```bash
54-
cargo build --features odbc-static
55-
```
56-
- No ODBC:
57-
- Disables ODBC support entirely.
58-
- Command:
59-
```bash
60-
cargo build --no-default-features
61-
```
62-
63-
Notes:
64-
- When cross-compiling in Docker, headers come from the base image (e.g. `unixodbc-dev`).
65-
- Runtime rpath on Linux includes `$ORIGIN/sqlpage:$ORIGIN/lib` so you can colocate drivers next to the binary when needed.
42+
SQLPage can either be built with an integrated odbc driver manager (static linking),
43+
or depend on having one already installed on the system where it is running (dynamic linking).
44+
45+
- Dynamic ODBC (default): `cargo build`
46+
- Static ODBC (Linux and MacOS only): `cargo build --features odbc-static`
47+
48+
Windows comes with ODBC pre-installed; SQLPage cannot statically link to the unixODBC driver manager on windows.
6649

6750
## Code Style and Linting
6851

6952
### Rust
53+
7054
- Use `cargo fmt` to format your Rust code
7155
- Run `cargo clippy` to catch common mistakes and improve code quality
7256
- All code must pass the following checks:
57+
7358
```bash
7459
cargo fmt --all -- --check
7560
cargo clippy
@@ -82,6 +67,7 @@ We use Biome for linting and formatting of the frontend code.
8267
```bash
8368
npx @biomejs/biome check .
8469
```
70+
8571
This will check the entire codebase (html, css, js).
8672

8773
## Testing
@@ -107,6 +93,7 @@ cargo test
10793
```
10894

10995
### End-to-End Tests
96+
11097
We use Playwright for end-to-end testing of dynamic frontend features.
11198
Tests are located in [`tests/end-to-end/`](./tests/end-to-end/). Key areas covered include:
11299

@@ -130,14 +117,15 @@ npm run test
130117
## Documentation
131118

132119
### Component Documentation
120+
133121
When adding new components, comprehensive documentation is required. Example from a component documentation:
134122

135123
```sql
136124
INSERT INTO component(name, icon, description, introduced_in_version) VALUES
137125
('component_name', 'icon_name', 'Description of the component', 'version');
138126

139127
-- Document all parameters
140-
INSERT INTO parameter(component, name, description, type, top_level, optional)
128+
INSERT INTO parameter(component, name, description, type, top_level, optional)
141129
VALUES ('component_name', 'param_name', 'param_description', 'TEXT|BOOLEAN|NUMBER|JSON|ICON|COLOR', false, true);
142130

143131
-- Include usage examples
@@ -154,6 +142,7 @@ If you are editing an existing component, edit the existing sql documentation fi
154142
If you are adding a new component, add a new sql file in the folder, and add the appropriate insert statements above.
155143

156144
### SQLPage Function Documentation
145+
157146
When adding new SQLPage functions, document them using a SQL migrations. Example structure:
158147

159148
```sql
@@ -195,6 +184,7 @@ VALUES (
195184
```
196185

197186
Key elements to include in function documentation:
187+
198188
- Clear description of the function's purpose
199189
- Version number where the function was introduced
200190
- Appropriate icon
@@ -206,11 +196,13 @@ Key elements to include in function documentation:
206196
## Pull Request Process
207197

208198
1. Create a new branch for your feature/fix:
199+
209200
```bash
210201
git checkout -b feature/your-feature-name
211202
```
212203

213204
2. Make your changes, ensuring:
205+
214206
- All tests pass
215207
- Code is properly formatted
216208
- New features are documented
@@ -229,6 +221,7 @@ git checkout -b feature/your-feature-name
229221
## Release Process
230222

231223
Releases are automated when pushing tags that match the pattern `v*` (e.g., `v1.0.0`). The CI pipeline will:
224+
232225
- Build and test the code
233226
- Create Docker images for multiple architectures
234227
- Push images to Docker Hub

0 commit comments

Comments
 (0)