Skip to content

Instantly share code, notes, and snippets.

View jordanlewis's full-sized avatar
👀
large data banking

Jordan Lewis jordanlewis

👀
large data banking
View GitHub Profile
root@:26257> set database=company;
SET
root@:26257> show tables;
+----------------+
| Table |
+----------------+
| PRODUCT_ORDERS |
| customers |
| orders |
| products |
[16:56]% gradle run jordan@Termato:~/repo/examples-orms/java/hibernate on hibernate
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:run
Dec 06, 2016 4:56:47 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {5.2.0.Final}
Dec 06, 2016 4:56:47 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Dec 06, 2016 4:56:47 PM org.hibernate.cfg.Environment buildBytecodeProvider
SELECT *
FROM (SELECT n.nspname,
c.relname,
a.attname,
a.atttypid,
a.attnotnull OR ((t.typtype = 'd') AND t.typnotnull) AS attnotnull,
a.atttypmod,
a.attlen,
ROW_NUMBER() OVER (PARTITION BY a.attrelid ORDER BY a.attnum) AS attnum,
pg_catalog.pg_get_expr(def.adbin,def.adrelid) AS adsrc,
=== RUN TestDockerCLI/test_txn_prompt.tcl
expect version 5.45
argv[0] = /usr/bin/expect argv[1] = -d argv[2] = -f argv[3] = /go/src/github.com/cockroachdb/cockroach/cli/interactive_tests/test_txn_prompt.tcl argv[4] = /cockroach/cockroach
set argc 1
set argv0 "/go/src/github.com/cockroachdb/cockroach/cli/interactive_tests/test_txn_prompt.tcl"
set argv "/cockroach/cockroach"
executing commands from command file /go/src/github.com/cockroachdb/cockroach/cli/interactive_tests/test_txn_prompt.tcl
system(rm -f .cockroachdb_history_test) = 2
system(/cockroach/cockroach start & echo $! > server_pid) = 2
CockroachDB node starting at 2017-01-30 16:44:45.866807348 +0000 UTC
I170206 17:27:50.257056 305 sql/executor.go:530 [client=[::1]:56597,user=jordan,n1] execRequest: set client_encoding to 'UTF8'
I170206 17:27:50.257208 305 sql/executor.go:856 [client=[::1]:56597,user=jordan,n1] executing 1/1: SET client_encoding = 'UTF8'
I170206 17:27:50.257657 305 sql/executor.go:530 [client=[::1]:56597,user=jordan,n1] execRequest: SET client_min_messages TO 'debug'
I170206 17:27:50.257728 305 sql/executor.go:856 [client=[::1]:56597,user=jordan,n1] executing 1/1: SET client_min_messages = 'debug'
I170206 17:27:50.258291 305 sql/executor.go:530 [client=[::1]:56597,user=jordan,n1] execRequest: SET standard_conforming_strings = on
I170206 17:27:50.258356 305 sql/executor.go:856 [client=[::1]:56597,user=jordan,n1] executing 1/1: SET standard_conforming_strings = 'on'
I170206 17:27:50.258618 305 sql/executor.go:530 [client=[::1]:56597,user=jordan,n1] execRequest: SET time zone 'UTC'
I170206 17:27:50.258653 305 sql/executor.go:856 [client=[::1]:56597,user=jordan,n1] executing 1/1: SET TIME
root@:26257/> create database test;
CREATE DATABASE
root@:26257/> set database=test;
SET
root@:26257/test> CREATE TABLE "Employees" ("EmployeeID" SERIAL, "LastName" VARCHAR(20) NOT NULL, "FirstName" VARCHAR(10) NOT NULL, "Title" VARCHAR(30) NULL, "TitleOfCourtesy" VARCHAR(25) NULL, "BirthDate" TIMESTAMP NULL, "HireDate" TIMESTAMP NULL, "Address" VARCHAR(60) NULL, "City" VARCHAR(15) NULL, "Region" VARCHAR(15) NULL, "PostalCode" VARCHAR(10) NULL, "Country" VARCHAR(15) NULL, "HomePhone" VARCHAR(24) NULL, "Extension" VARCHAR(4) NULL, "Photo" BYTEA NULL, "Notes" TEXT NULL, "ReportsTo" INT NULL, "PhotoPath" VARCHAR(255) NULL, CONSTRAINT "PK_Employees" PRIMARY KEY ("EmployeeID"), CONSTRAINT "FK_Employees_Employees" FOREIGN KEY ("ReportsTo") REFERENCES "Employees" ("EmployeeID"), CONSTRAINT "CK_Birthdate" CHECK ("BirthDate" < current_date()));
CREATE TABLE
root@:26257/test> CREATE TABLE "Categories" ("CategoryID" SERIAL, "CategoryName" VARCHAR(15) NOT NULL, "Description" TEXT NULL, "Picture" BYTEA NULL, CONSTRAINT "P
import psycopg2
binary = b'\xff\xd8\xff\xe0\x00\x10'
conn = psycopg2.connect('postgresql://root@localhost:26257/test?sslmode=disable')
with conn as conn, conn.cursor() as c:
c.execute('select %s::BYTEA', (binary, ))
rv, = c.fetchone()
@jordanlewis
jordanlewis / .block
Created May 21, 2017 17:58 — forked from drzax/.block
Narrative Charts
license: mit
scrolling: true
height: 300
license: mit
scrolling: true
height: 300
#!/usr/bin/python
class T(object):
def __init__(self, n=0, lists=None):
self.lists = lists if lists is not None else []
if lists is None:
# lists contains normal lists and t's as well
self.lists = []
# cached length prefix
self.n = n