question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update debug task to make the debug query an adapter method

See original GitHub issue

The existing code is here: https://github.com/fishtown-analytics/dbt/blob/fa8a4f2020655c60bdb66270616f5654e168a729/core/dbt/task/debug.py#L337

But that won’t work on some third party adapters. One example is Oracle, which requires a from clause in any select statement.

Instead, this should be an adapter method on the base adapter, named debug_query() that takes no arguments. Then adapter plugins will be able to override the method with an appropriate debug method. For example, on Oracle, it might be select 1 from dual.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
beckjakecommented, Sep 14, 2020

@jtcohen6 it looks like on oracle, selects require a FROM clause and their solution to the obvious problems that causes is a special identifier named dual that’s globally accessible.

If that is the case, we probably should have an adapter.debug_query() method that defaults to adapter.execute("select 1 as id"). Then the author of the oracle plugin (or other databases with similar restrictions) can add their oracle-only special case behavior.

0reactions
jtcohen6commented, Oct 5, 2020

@zmac12 I think you had the right start in #2811, I’ll comment over there

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugger Extension - Visual Studio Code
A DebugAdapterDescriptorFactory has a method createDebugAdapterDescriptor that is called by VS Code when a debug session starts and a debug adapter is needed....
Read more >
Best practices for debugging and organizing scripting code in ...
Debug the scripts easily. Update the scripts at runtime without it being necessary to go back to Case Builder and redeploy the solution....
Read more >
TaskDebugAdapterAction - Nova
A TaskDebugAdapterAction object represents an action that can be used as part of a Task which invokes a debug adapter conforming to the...
Read more >
Debugging
Getting Started. Open a file to debug (either package main source file or the test file) in the editor, and select the Run...
Read more >
Create and configure TableAdapters - Visual Studio (Windows)
Use the TableAdapter Configuration Wizard · You have the option to create a new stored procedure in the underlying database if you have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found