Skip to content

Commit 8253549

Browse files
committed
init
0 parents  commit 8253549

29 files changed

Lines changed: 4831 additions & 0 deletions

.github/workflows/images.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Create and publish Docker images
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
10+
jobs:
11+
build-and-push-images:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
attestations: write
17+
id-token: write
18+
strategy:
19+
matrix:
20+
image:
21+
- name: sql_to_text
22+
context: ./sql_to_text
23+
- name: sql_generator
24+
context: ./sql_generator
25+
- name: sql_validation
26+
context: ./sql_feedback
27+
- name: sql_feedback
28+
context: ./sql_feedback
29+
- name: sql_runner
30+
context: ./sql_runner
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v5
34+
35+
- name: Log in to the Container registry
36+
uses: docker/login-action@v3
37+
with:
38+
registry: ${{ env.REGISTRY }}
39+
username: ${{ github.actor }}
40+
password: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Extract metadata (tags, labels) for Docker
43+
id: meta
44+
uses: docker/metadata-action@v5
45+
with:
46+
images: ${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.image.name }}
47+
48+
- name: Build and push Docker image
49+
id: push
50+
uses: docker/build-push-action@v5
51+
with:
52+
context: ${{ matrix.image.context }}
53+
file: ${{ matrix.image.dockerfile }}
54+
push: true
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}
57+
58+
- name: Generate artifact attestation
59+
uses: actions/attest-build-provenance@v3
60+
with:
61+
subject-name: ${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.image.name }}
62+
subject-digest: ${{ steps.push.outputs.digest }}
63+
push-to-registry: true

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# dependencies
2+
node_modules/
3+
4+
# testing
5+
/coverage/
6+
7+
# production
8+
/dist/
9+
10+
# environment
11+
.env
12+
.env.*
13+
!.env.example
14+
15+
# editor
16+
.vscode/*
17+
!.vscode/extensions.json
18+
!.vscode/settings.json
19+
.idea/
20+
21+
# typescript
22+
*.tsbuildinfo
23+
24+
# debug
25+
.pnpm-debug.log*
26+
27+
# os
28+
.DS_Store
29+
Thumbs.db
30+
31+
**/log/*
32+
33+
test.json

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["biomejs.biome"]
3+
}

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"editor.rulers": [100],
3+
"editor.formatOnSave": true,
4+
"biome.enabled": true,
5+
"editor.defaultFormatter": "biomejs.biome",
6+
"editor.codeActionsOnSave": {
7+
"source.organizeImports.biome": "explicit"
8+
},
9+
"typescript.tsdk": "node_modules/typescript/lib"
10+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Paul Christ
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SQL-Assessment
2+
3+
## This repository holds multiple functions to generate, evaluate and give feedback on SQL-assessments
4+
5+
- DB_introspection
6+
- DB_annotation
7+
- SQL_executor
8+
- SQL_generator
9+
- SQL_to_text
10+
- SQL_feedback
11+
- compare_tabular_results
12+
13+
### SQL_executor
14+
15+
```bash
16+
npx tsx src/sql_executor/Executor.ts "{\"args\": {\"query\": \"select * from ang_pro limit 5;\"}}" > test.json
17+
```
18+
19+
### compare_tabular_results
20+
21+
```bash
22+
npx tsx src/compare_tabular_results/Comparator.ts "{\"args\": {\"referenceResult\": [{\"COLUMN_A\":50}], \"studentResult\": [{\"COLUMN_A\":50}]}}" > test.json
23+
```
24+
25+
### DB_introspection
26+
27+
```bash
28+
npx tsx src/db_introspection/Introspector.ts > test.json
29+
```
30+
31+
## Run tests

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default { extends: ["@commitlint/config-conventional"] };

esbuild.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { spawn } from "node:child_process";
2+
import { join } from "node:path";
3+
import { build, context } from "esbuild";
4+
import { esbuildVersion } from "vitest/node";
5+
6+
const buildOptions = {
7+
entryPoints: ["./src/sql_executor/Executor.ts", "./src/compare_tabular_results/Comparator.ts"],
8+
bundle: true,
9+
outdir: "dist",
10+
format: "esm",
11+
platform: "node",
12+
target: "node22",
13+
sourcemap: true,
14+
plugins: [],
15+
};
16+
17+
await build(buildOptions);

0 commit comments

Comments
 (0)