We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I guess having at least one kind of SQL dialect implement would be a good addition.
I'm gonna try and submit a PR sometime soon for .sql > SQLite support.
.sql
The text was updated successfully, but these errors were encountered:
Unfortunately I didn't had much time to learn how to create a new integration following dexec conventions.
dexec
I started with a simple Dockerfile:
Dockerfile
FROM ubuntu:14.04 MAINTAINER alixaxel ENV LANG C.UTF-8 RUN apt-get update -qq -y && \ apt-get install -y sqlite3 && \ apt-get clean VOLUME /tmp/dexec/build
And then:
docker build -t dexec/lang-sqlite .
To test it, I created a new file (HelloWorld.sql) with the following contents:
HelloWorld.sql
CREATE TABLE "primes" ( "id" INTEGER NOT NULL, "is_prime" INTEGER NOT NULL DEFAULT (0) ); INSERT INTO "primes" ("id", "is_prime") VALUES (1, 0); INSERT INTO "primes" ("id", "is_prime") VALUES (2, 1); INSERT INTO "primes" ("id", "is_prime") VALUES (3, 1); INSERT INTO "primes" ("id", "is_prime") VALUES (4, 0); INSERT INTO "primes" ("id", "is_prime") VALUES (5, 1); INSERT INTO "primes" ("id", "is_prime") VALUES (6, 0); INSERT INTO "primes" ("id", "is_prime") VALUES (7, 1); INSERT INTO "primes" ("id", "is_prime") VALUES (8, 0); INSERT INTO "primes" ("id", "is_prime") VALUES (9, 0); SELECT 'Hello World!'; SELECT COUNT(1) FROM "primes" WHERE "is_prime" = 0; SELECT COUNT(1) FROM "primes" WHERE "is_prime" = 1;
And executed it directly with the containers SQLite 3 binary:
docker run --rm -v $(pwd -P)/HelloWorld.sql:/tmp/dexec/build/HelloWorld.sql \ dexec/lang-sqlite sqlite3 \ --init /tmp/dexec/build/HelloWorld.sql
It's also possible to "annex" additional query commands within the context of the SQL file:
docker run --rm -v $(pwd -P)/HelloWorld.sql:/tmp/dexec/build/HelloWorld.sql \ dexec/lang-sqlite sqlite3 \ --init /tmp/dexec/build/HelloWorld.sql \ --cmd 'SELECT SUM("id") FROM "primes" WHERE "is_prime" = 1;'
The output of that being:
Hello World! 5 4 17
@andystanton Could you give some guidance on how to integrate additional languages?
Sorry, something went wrong.
No branches or pull requests
I guess having at least one kind of SQL dialect implement would be a good addition.
I'm gonna try and submit a PR sometime soon for
.sql
> SQLite support.The text was updated successfully, but these errors were encountered: