Skip to content

Instantly share code, notes, and snippets.

View javier's full-sized avatar

javier ramírez javier

View GitHub Profile
@javier
javier / odbQuest.py
Last active April 25, 2023 09:41
QuestDB ODBC ILP
# configuring ODBC https://solutions.posit.co/connections/db/best-practices/drivers/
# using ODBC from python https://github.com/mkleehammer/pyodbc/wiki/Getting-started
import pyodbc
con = pyodbc.connect(
driver = 'PostgreSQL Driver',
database = 'qdb',
server = 'localhost',
port = 8812,
uid = 'admin',
@javier
javier / questdb_partition_remover.sh
Last active October 23, 2023 10:37
questdb_cron_remove_partitions
#!/bin/bash
# This script needs both curl and jq installed.
# It will go over all the tables with daily partitioning and will remove all partitions older than 5000 days (change that after you are sure it works as you expect)
# It uses jq to parse the JSON output from the REST API, extracting the "dataset" element and flatten all the rows.
# Then it reads line by line and calls the QuestDB API with each ALTER TABLE statement.
# We get all the tables with daily partitioning and compose the ALTER TABLE statements
@javier
javier / Exif-questdb-schema.sql
Created January 10, 2024 11:05
Exif-questdb-schema
CREATE TABLE CameraDetails (
Manufacturer SYMBOL,
Model SYMBOL,
Orientation SYMBOL,
Software STRING,
DateAndTime timestamp,
YCbCrPositioning SYMBOL,
Compression SYMBOL,
XResolution LONG,
YResolution LONG,
@javier
javier / grafana instructions.md
Last active May 15, 2024 15:53
grafana with local storage and local grafana plugin

Just create a subfolder for your test with a subfolder named volume and another subfolder inside volume named plugins. Unzip the plugin zip directly into the plugins folder. A subfolder with the plugin name should appear

Now start grafana as in

docker run --rm  -p 3000:3000 --name=grafana-plugin --user "$(id -u)" --volume "$PWD/volume:/var/lib/grafana"  grafana/grafana-oss
@javier
javier / 00-QuestDB SQL Window Functions Example - Intro.md
Last active August 27, 2024 18:51
QuestDB SQL Window Functions Example
@javier
javier / demo_basic_jupyter.ipynb
Last active October 25, 2024 15:56
demo_basic_jupyter.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.