Skip to content

Instantly share code, notes, and snippets.

View iamsaquib8's full-sized avatar
๐Ÿœ
Developing

Saquib Ul Hassan iamsaquib8

๐Ÿœ
Developing
View GitHub Profile
@iamsaquib8
iamsaquib8 / proxy.db
Created February 18, 2020 14:18
SQLite3 JSON1 demonstration
// CREATE Proxy config to store proxy in an sqlite database with a list of IPs as JSON in peers column
CREATE TABLE "proxy_config" (
"id" char(36) DEFAULT (lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-' || substr('89ab',abs(random()) % 4 + 1, 1) || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6)))) NOT NULL PRIMARY KEY,
"peers" JSON,
"server" TEXT,
"state" INTEGER,
"ts" DATETIME default current_timestamp,
"ts_mod" DATETIME default current_timestamp
);