Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ permissions:
jobs:
test:
services:
mongodb:
image: mongo:8.0
env:
MONGO_INITDB_ROOT_USERNAME: test_user
MONGO_INITDB_ROOT_PASSWORD: test_pass
ports:
- 27017:27017
options: >-
--health-cmd="mongosh --quiet --eval 'db.adminCommand({ping: 1})'"
--health-interval=5s
--health-timeout=5s
--health-retries=10
db:
image: postgres:12
ports: ["5432:5432"]
Expand Down Expand Up @@ -123,6 +135,7 @@ jobs:

- name: Seed adapter test databases
run: |
docker exec -i ${{ job.services.mongodb.id }} mongosh --quiet -u test_user -p test_pass --authenticationDatabase admin < test/support/adapters/mongodb-seed.js
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "CREATE DATABASE test_db;"
PGPASSWORD=postgres psql -h localhost -U postgres -d test_db -f test/support/adapters/postgresql-seed.sql
mysql -h 127.0.0.1 -uroot -proot_pass -e "CREATE DATABASE IF NOT EXISTS test_db;"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ QueryCanary is a lightweight tool for monitoring your production data using SQL.
## What It Does

- ✅ Run SQL checks against your production database
- ✅ Query MongoDB with JSON find, count, distinct and aggregation commands
- ✅ Schedule checks with simple choices, local times, or custom cron expressions
- ✅ Get alerts via email or Slack when values drift or break
- ✅ See historical trends and chart results over time
Expand Down
3 changes: 2 additions & 1 deletion assets/js/hooks/sql_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { EditorView, basicSetup } from 'codemirror';
import { EditorState } from '@codemirror/state';
import { keymap } from "@codemirror/view"
import { sql, PostgreSQL, MySQL } from '@codemirror/lang-sql';
import { json } from '@codemirror/lang-json';
import { indentWithTab } from "@codemirror/commands";
import {
acceptCompletion
Expand Down Expand Up @@ -47,7 +48,7 @@ const SQLEditor = {
}

// Configure SQL extension with properly formatted schema
const sqlLang = sql({
const sqlLang = this.el.dataset.dialect === 'mongodb' ? json() : sql({
dialect: dialect,
schema: schemaData || []
});
Expand Down
22 changes: 22 additions & 0 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"dependencies": {
"@codemirror/autocomplete": "^6.18.3",
"@codemirror/commands": "^6.7.1",
"@codemirror/lang-json": "^6.0.2",
"@codemirror/lang-sql": "^6.8.0",
"@codemirror/language": "^6.10.6",
"@codemirror/lint": "^6.8.4",
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.adapters.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
version: "3.9"
services:
mongodb:
image: mongo:8.0
environment:
MONGO_INITDB_ROOT_USERNAME: test_user
MONGO_INITDB_ROOT_PASSWORD: test_pass
ports:
- "27017:27017"
volumes:
- ./test/support/adapters/mongodb-seed.js:/docker-entrypoint-initdb.d/seed.js

postgres:
image: postgres:15
restart: always
Expand Down
Loading
Loading