--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/eab246d8-2947-4686-9d29-1be0e1ca6182%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Marek,Thank you very much for your interest in using jOOQ's parser for your product. What you're planning to do sounds exactly like what we want to be able to do, and offer as a library, with the parser / translator.However, there is still much work to do on our side. In order to be able to associate parser artefacts, such as a mapping between the position in an input string and a QueryPart, we'll have to re-design our QueryPart internals and make them a public API. This will be a priority for the next few jOOQ releases, but we're not quite there yet. Right now, you would have to look into jOOQ's internals (possibly open them up using reflection) to get access to this kind of information.Do note that there's a related discussion on GitHub where Scott McKinney plans to use jOOQ as a SQL parser for Manifold:If you're interested in continuing your jOOQ evaluation, we'd be very keen on learning what kinds of requirements you may have from a future jOOQ.Best Regards,Lukas
On Wed, Jul 17, 2019 at 2:36 PM marekgregor <marek...@gmail.com> wrote:
Hi,--I am seriously considering implementation of Jupyter Notebook Kernel for SQL (+Java) language utilizing JOOQ.The Kernel will be capable to:- simultaneously connect to various databases for multiple users utilizing connection pooling,- provide database metadata to client (tables, columns, foreign keys, views, stored procs,...) utilizing JOOQ implementation,- execute database native SQL or standardized SQL translated to native SQL by JOOQ parser functionality and return it's results to clientKernel could also support autocomplete and introspection for SQL code written in editor on client side of Jupyter Notebook. The API implemented by kernel for autocomplete is pretty simple: client sends code (SQL) string and cursor position, kernel response contains list of autocomplete recommendation strings etc.I am curious if it is possible to use JOOQ for parsing SQL to QueryPart(s), identify which QueryPart corresponds to defined SQL string cursor position and return corresponding autocomplete strings (e.g. with names of available tables in FROM clause, or names of columns in SELECT clause). I don't know if it is suitable to use JOOQ for this task and how.thanks for response
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jooq-user/2wPGf6uB5fI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/6818c855-1a51-47be-9af8-73934b3bc407%40googlegroups.com.
Hi Lukas,thank you, that's amazing I didn't realize before, that this feature is also implementable. For my initial use case JdbcDatabase and it's descendands is far enough - users of my app will pass JDBC connection params, and the app will display database metadata and allow executing standardized SQL processed by JOOQ Parser to get data for reports.
But this brings to my head another question about JOOQ licensing ...I know that in standard case, model generation (from metadata) and writing parseable SQL is done by developer (therefore I think per developer license is reasonable here). But in my case this JOOQ functionality will be used by application users and not developers, albeit without directly using JOOQ java API. My app takes this case into the extreme, because my Jupiter Notebook Kernel will also allow execute standard java code (besides SQL execution) to further process SQL results (java code execution will be definitely available without JOOQ libraries in classpath). Therefore the essential question is, if the license cost will be counted per developer or per app user for my app.
Possibility to create "universal report" (by using standard, translatable SQL) executable on any supported database with the same schema is one of the amazing features, which are possible to do with JOOQ. There are a lot of applications, which support multiple databases (e.g. like JIRA internally using Hibernate) and the possibility for company to create universal report executable on any db engine is one of the big "sellpoints" of my proposal. There are also other nice features possible, like static validation of existing SQL queries (reports) when schema is upgraded etc. But if it makes any significant change in JOOQ licensing for me I am ready to postpone this feature for now and not to present it as planned for first version (I am planning to start Kickstarter project for it), and use JOOQ only for database metadata analysis tool and native SQL execution wrapper.
I'm assuming you mean the JdbcDatabase from jOOQ-meta?
--
You received this message because you are subscribed to a topic in the Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jooq-user/2wPGf6uB5fI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO7JeJsanzuZazdQdOWK7NRaqhSARr-yoRDFM4Obx0nPwg%40mail.gmail.com.
To unsubscribe from this group and all its topics, send an email to jooq-user+unsubscribe@googlegroups.com.
public class DbScannerTest {
public static void main(String[] args) {
String url = "jdbc:postgresql://localhost/DEMO_Basic1_SysCfg";
Properties props = new Properties();
props.setProperty("user", "postgres");
props.setProperty("password", "swx");
try (Connection conn = DriverManager.getConnection(url, props)) {
final DSLContext dsl = DSL.using(conn, SQLDialect.POSTGRES);
final Meta specialMeta = dsl.meta(Source.of("CREATE TABLE tutorials_tbl ( " +
" id INT NOT NULL, " +
" title VARCHAR(50) NOT NULL, " +
" author VARCHAR(20) NOT NULL, " +
" submission_date DATE, " +
");"));
} catch (SQLException e) {
e.printStackTrace();
}
}
}
with error:
"C:\Program Files\AdoptOpenJDK\jdk-11.0.3.7-hotspot\bin\java.exe " ..." DbScannerTest
Connected to the target VM, address: '127.0.0.1:49792', transport: 'socket'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jooq.tools.reflect.Reflect (file:/C:/Users/mgregor/.m2/repository/org/jooq/jooq/3.12.0/jooq-3.12.0.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class)
WARNING: Please consider reporting this to the maintainers of org.jooq.tools.reflect.Reflect
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
sep 02, 2019 10:11:33 AM org.jooq.tools.JooqLogger error
SEVERE: An exception occurred while parsing a DDL script: Identifier expected: [1:138] ...or VARCHAR(20) NOT NULL, submission_date DATE, [*]);. Please report this error to https://github.com/jOOQ/jOOQ/issues/new
org.jooq.impl.ParserException: Identifier expected: [1:138] ...or VARCHAR(20) NOT NULL, submission_date DATE, [*]);
at org.jooq.impl.ParserContext.expected(ParserImpl.java:10641)
at org.jooq.impl.ParserImpl.parseIdentifier(ParserImpl.java:8935)
at org.jooq.impl.ParserImpl.parseIdentifier(ParserImpl.java:8928)
at org.jooq.impl.ParserImpl.parseCreateTable(ParserImpl.java:3177)
at org.jooq.impl.ParserImpl.parseCreate(ParserImpl.java:2143)
at org.jooq.impl.ParserImpl.parseQuery(ParserImpl.java:844)
at org.jooq.impl.ParserImpl.parse(ParserImpl.java:542)
at org.jooq.impl.ParserImpl.parse(ParserImpl.java:529)
at org.jooq.impl.DDLDatabaseInitializer.loadScript(DDLDatabaseInitializer.java:172)
at org.jooq.impl.DDLDatabaseInitializer.initializeUsing(DDLDatabaseInitializer.java:153)
at org.jooq.impl.DDLMetaProvider.provide(DDLMetaProvider.java:69)
at org.jooq.impl.DefaultDSLContext.meta(DefaultDSLContext.java:443)
at DbScannerTest.main(DbScannerTest.java:24)
Exception in thread "main" org.jooq.impl.ParserException: Identifier expected: [1:138] ...or VARCHAR(20) NOT NULL, submission_date DATE, [*]);
at org.jooq.impl.ParserContext.expected(ParserImpl.java:10641)
at org.jooq.impl.ParserImpl.parseIdentifier(ParserImpl.java:8935)
at org.jooq.impl.ParserImpl.parseIdentifier(ParserImpl.java:8928)
at org.jooq.impl.ParserImpl.parseCreateTable(ParserImpl.java:3177)
at org.jooq.impl.ParserImpl.parseCreate(ParserImpl.java:2143)
at org.jooq.impl.ParserImpl.parseQuery(ParserImpl.java:844)
at org.jooq.impl.ParserImpl.parse(ParserImpl.java:542)
at org.jooq.impl.ParserImpl.parse(ParserImpl.java:529)
at org.jooq.impl.DDLDatabaseInitializer.loadScript(DDLDatabaseInitializer.java:172)
at org.jooq.impl.DDLDatabaseInitializer.initializeUsing(DDLDatabaseInitializer.java:153)
at org.jooq.impl.DDLMetaProvider.provide(DDLMetaProvider.java:69)
at org.jooq.impl.DefaultDSLContext.meta(DefaultDSLContext.java:443)
at DbScannerTest.main(DbScannerTest.java:24)
Lukas
To unsubscribe from this group and all its topics, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO7JeJsanzuZazdQdOWK7NRaqhSARr-yoRDFM4Obx0nPwg%40mail.gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jooq-user/2wPGf6uB5fI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/4d45b28c-4da4-4a1a-9bbc-b5203d32f002%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CACtQWuQKyNHYpA-y6aTK3_C5oXitoy0J-Vznp7ZbniRfKY96JA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO43X3g5KRrHjaVhTqTYMFzG1oTR3h1qicAG19gF1ASOeA%40mail.gmail.com.
Hello Lukas,thanks a lot for response, I am sorry, I have not noticed the obvious bug in my DDL, the reflection warnings deceived me.
I have not realized that parsing unqualified column names is not so straightforward to implement, I think existing state - using qualified names is perfectly fine for use.
Feature of parsing with meta lookups (.withParseWithMetaLookups(THROW_ON_FAILURE)) is perfect for validation of queries without even running them, this I think will be killer feature for any reporting tool ;). In DslContext.meta() I miss only one thing - possibility to list and run stored procedures (org.jooq.Routine) in some dynamic way without static generation. But this could be also implemented by me when needed, by reverse engineering code of org.jooq.codegen.JavaGenerator#generateRoutines in a way to support dynamic calling of routines without code generation ...
--
You received this message because you are subscribed to a topic in the Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jooq-user/2wPGf6uB5fI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO7idb5UxrNU8Lr0WAhkdHHaR1ZnaO50JqkLYQzRfxQTSw%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CACtQWuTJECGZO9cf0s91HxBWaDVvnAVaBYCSHvAUQNoSa379fw%40mail.gmail.com.