Skip to content

Commit 22ad006

Browse files
committed
Initial
0 parents  commit 22ad006

77 files changed

Lines changed: 11390 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/thumbnail.png

284 KB
Loading

.gitignore

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
.env
2+
packages/backend/docker-compose.yml
3+
node_modules
4+
.DS_Store
5+
npm-debug.log
6+
yarn-debug.log
7+
yarn-error.log
8+
9+
dist
10+
.npmrc
11+
12+
packages/electron/out
13+
14+
logs
15+
*.log
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
pnpm-debug.log*
20+
lerna-debug.log*
21+
22+
23+
dist-ssr
24+
coverage
25+
*.local
26+
27+
.vscode/*
28+
!.vscode/extensions.json
29+
.idea
30+
*.suo
31+
*.ntvs*
32+
*.njsproj
33+
*.sln
34+
*.sw?
35+
36+
*.tsbuildinfo
37+
38+
39+
40+
41+
# Logs
42+
logs
43+
*.log
44+
npm-debug.log*
45+
yarn-debug.log*
46+
yarn-error.log*
47+
lerna-debug.log*
48+
49+
# Diagnostic reports (https://nodejs.org/api/report.html)
50+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
51+
52+
# Runtime data
53+
pids
54+
*.pid
55+
*.seed
56+
*.pid.lock
57+
.DS_Store
58+
59+
# Directory for instrumented libs generated by jscoverage/JSCover
60+
lib-cov
61+
62+
# Coverage directory used by tools like istanbul
63+
coverage
64+
*.lcov
65+
66+
# nyc test coverage
67+
.nyc_output
68+
69+
# node-waf configuration
70+
.lock-wscript
71+
72+
# Compiled binary addons (https://nodejs.org/api/addons.html)
73+
build/Release
74+
75+
# Dependency directories
76+
node_modules/
77+
jspm_packages/
78+
79+
# TypeScript v1 declaration files
80+
typings/
81+
82+
# TypeScript cache
83+
*.tsbuildinfo
84+
85+
# Optional npm cache directory
86+
.npm
87+
88+
# Optional eslint cache
89+
.eslintcache
90+
91+
# Optional REPL history
92+
.node_repl_history
93+
94+
# Output of 'npm pack'
95+
*.tgz
96+
97+
# Yarn Integrity file
98+
.yarn-integrity
99+
100+
# dotenv environment variables file
101+
.env.test
102+
103+
# parcel-bundler cache (https://parceljs.org/)
104+
.cache
105+
106+
# next.js build output
107+
.next
108+
109+
# nuxt.js build output
110+
.nuxt
111+
112+
# vuepress build output
113+
.vuepress/dist
114+
115+
# Serverless directories
116+
.serverless/
117+
118+
# FuseBox cache
119+
.fusebox/
120+
121+
# DynamoDB Local files
122+
.dynamodb/
123+
124+
# Webpack
125+
.webpack/
126+
127+
# Vite
128+
.vite/
129+
130+
# Electron-Forge
131+
out/

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# StarQuery - A tool to rule them all
2+
> This tool is `Work in Progress` and in development stage. There are no guarantees that it will work as expected and no releases.
3+
4+
<img src="/.github/thumbnail.png"/>
5+
6+
## Planned Support
7+
- [ ] Database
8+
- SQL
9+
- [ ] MySQL
10+
- [ ] PostgreSQL
11+
- [ ] SQLite (local only)
12+
- [ ] MSSQL
13+
- [ ] MariaDB
14+
- [ ] Oracle
15+
- [ ] CockroachDB
16+
- [ ] ClickHouse
17+
- [ ] MongoDB
18+
- Search
19+
- [ ] Elasticsearch
20+
- API's
21+
- [ ] Rest API
22+
- [ ] GraphQL
23+
- [ ] gRPC
24+
- [ ] OpenAPI

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "starquery",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC"
12+
}

packages/backend/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Backend spec
2+
3+
4+
## Organizations `Coming soon`
5+
### `GET` /api/organizations
6+
7+
## Projects
8+
### `GET` /api/organizations/:organization/projects
9+
### `POST` /api/organizations/:organization/projects
10+
### `GET` /api/organizations/:organization/projects/:name
11+
### `PUT` /api/organizations/:organization/projects/:name
12+
13+
## Sources
14+
### `GET` /api/organizations/:organization/projects/:name/sources
15+
16+
```json
17+
{
18+
"data": [
19+
{
20+
"name": "pastefy",
21+
"type": "sql",
22+
"driver": "mysql"
23+
}
24+
]
25+
}
26+
```
27+
### `POST` /api/organizations/:organization/projects/:name/sources
28+
29+
## Source
30+
### `WS` /api/organizations/:organization/projects/:name/sources:source/sql
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: '3.3'
2+
3+
services:
4+
db:
5+
image: mariadb:10.11
6+
ports:
7+
- "3306:3306"
8+
volumes:
9+
- dbvol:/var/lib/mysql
10+
11+
environment:
12+
MYSQL_ROOT_PASSWORD: pastefy
13+
MYSQL_DATABASE: pastefy
14+
MYSQL_USER: pastefy
15+
MYSQL_PASSWORD: pastefy
16+
17+
pastefy:
18+
depends_on:
19+
- db
20+
image: interaapps/pastefy:latest
21+
ports:
22+
- "9999:80"
23+
24+
environment:
25+
HTTP_SERVER_PORT: 80
26+
HTTP_SERVER_CORS: "*"
27+
DATABASE_DRIVER: mysql
28+
DATABASE_NAME: pastefy
29+
DATABASE_USER: pastefy
30+
DATABASE_PASSWORD: pastefy
31+
DATABASE_HOST: db
32+
DATABASE_PORT: 3306
33+
SERVER_NAME: "http://localhost:9999"
34+
# There is INTERAAPPS, GOOGLE, GITHUB, DISCORD, TWITCH
35+
OAUTH2_PROVIDER_CLIENT_ID:
36+
OAUTH2_PROVIDER_CLIENT_SECRET:
37+
38+
volumes:
39+
dbvol:

packages/backend/package-lock.json

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/backend/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "backend",
3+
"version": "1.0.0",
4+
"description": "",
5+
"type": "module",
6+
"main": "index.js",
7+
"scripts": {
8+
"test": "echo \"Error: no test specified\" && exit 1",
9+
"start": "pnpx tsx src/index.ts"
10+
},
11+
"keywords": [],
12+
"author": "",
13+
"license": "ISC",
14+
"dependencies": {
15+
"@types/body-parser": "^1.19.5",
16+
"@types/express": "^5.0.2",
17+
"@types/express-ws": "^3.0.5",
18+
"body-parser": "^2.2.0",
19+
"express": "^5.0.2",
20+
"express-ws": "^5.0.2",
21+
"mysql2": "^3.14.1",
22+
"nodemon": "^3.1.10",
23+
"ts-node": "^10.9.2",
24+
"ws": "^8.18.2"
25+
}
26+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export type ResultType = 'SELECT' | 'RESULT'
2+
3+
export type SQLTypes = 'VARCHAR' | 'INT' | 'FLOAT' | 'DOUBLE' | 'BOOLEAN' | 'DATETIME' | 'TIMESTAMP' | 'DATE' | 'TIME' | 'YEAR' | 'DECIMAL' | 'CHAR' | 'TEXT' | 'BLOB' | 'ENUM' | 'SET' | 'TINYINT' | 'SMALLINT' | 'MEDIUMINT' | 'BIGINT' | 'BIT' | 'JSON' | 'XML' | 'UUID'
4+
5+
export type QueryResult = {
6+
type: 'SELECT'
7+
columns: string[]
8+
rows: any[]
9+
} | {
10+
type: 'RESULT'
11+
result: any
12+
}
13+
14+
export abstract class DefaultSQLAdapter {
15+
constructor() {}
16+
17+
abstract connect(): Promise<void>;
18+
abstract close(): Promise<void>;
19+
20+
abstract getTables();
21+
abstract execute(sql: string, params?: any[]|undefined): Promise<QueryResult>;
22+
}

0 commit comments

Comments
 (0)