isaac-mcfadyen / d1-jdbc-driver

A JDBC driver for Cloudflare's D1 product, compatible with Jetbrains tools.
GNU General Public License v3.0
74 stars 5 forks source link

Select anything but * seems to fail #3

Open kingmesal opened 9 months ago

kingmesal commented 9 months ago

where mytable has a primary key of mykey the follow queries error: select distinct field from mytable select field from mytable

They succeed in the CF D1 console.

I tested 3 different tools, just to make sure.

from dbeaver:

org.jkiss.dbeaver.model.sql.DBSQLException: SQL Error: Internal jdbc driver error
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:133)
    at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:600)
    at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$2(SQLQueryJob.java:503)
    at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:190)
    at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:510)
    at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:962)
    at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:4130)
    at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:123)
    at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:190)
    at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:121)
    at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$ResultSetDataPumpJob.run(ResultSetViewer.java:5148)
    at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.sql.SQLException: Internal jdbc driver error
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.handleExecuteError(JDBCStatementImpl.java:295)
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:332)
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:131)
    ... 12 more
Caused by: org.json.JSONException: JSONObject["ip"] not found.
    at org.json.JSONObject.get(JSONObject.java:587)
    at org.isaacmcfadyen.D1Queryable.generateResultSet(D1Queryable.java:69)
    at org.isaacmcfadyen.D1Statement.execute(D1Statement.java:107)
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:330)
    ... 13 more

From datagrip: [2024-01-09 16:16:29] JSONObject["mykey"] not found.

from dbvis:

This is an error produced by the JDBC driver

[Exception Chain]:
1:        This is an error produced by the JDBC driver
2: Root-> (JSONException) JSONObject["company_id"] not found.

[Stack trace]:
com.onseven.dbvis.m.f.t: org.json.JSONException: JSONObject["mykey"] not found.
    at com.onseven.dbvis.m.f.m.xe(Z:1315)
    at com.onseven.dbvis.m.f.r.xe(Z:3203)
    at com.onseven.dbvis.m.f.db.ne(Z:3457)
    at com.onseven.dbvis.m.f.db.ud(Z:2710)
    at com.onseven.dbvis.m.f.c.b.b.cb.f(Z:2440)
    at com.onseven.dbvis.m.f.c.b.b.cb.b(Z:1653)
    at com.onseven.dbvis.m.f.c.b.b.cb.w(Z:617)
    at com.onseven.dbvis.m.f.c.b.k.s(Z:1542)
    at com.onseven.dbvis.m.f.c.g.d(Z:322)
    at com.onseven.dbvis.m.f.c.g.ib(Z:2352)
    at com.onseven.dbvis.m.f.c.g.xe(Z:2910)
    at com.onseven.dbvis.m.f.db.ne(Z:3457)
    at com.onseven.dbvis.m.f.n.c(Z:1374)
    at com.onseven.dbvis.m.f.n.doInBackground(Z:1521)
    at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.json.JSONException: JSONObject["mykey"] not found.
    at org.json.JSONObject.get(JSONObject.java:587)
    at org.isaacmcfadyen.D1Queryable.generateResultSet(D1Queryable.java:69)
    at org.isaacmcfadyen.D1Statement.execute(D1Statement.java:107)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at com.onseven.dbvis.jdbc.b.c.d(Z:2806)
    at com.onseven.dbvis.t.i.b(Z:607)
    at com.onseven.dbvis.jdbc.b.g.b(Z:317)
    at com.onseven.dbvis.jdbc.b.c.b(Z:2806)
    at com.onseven.dbvis.jdbc.b.g$_b.call(Z:618)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    ... 3 more
steebchen commented 5 months ago

I can confirm, only select * seems to work