-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
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
Support for SQL[ite] #44
Comments
Unfortunately I didn't had much time to learn how to create a new integration following I started with a simple
And then: docker build -t dexec/lang-sqlite . To test it, I created a new file ( 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:
@andystanton Could you give some guidance on how to integrate additional languages? |
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: