Data Source Introspection Scope "All Schemas"

Answered

Hello,

My DDEV Integration Plugin creates an auto configured data source for the database of the DDEV development environment.

A new feature request is asking for scanning "All schemas" by default (Enable 'All schemas' setting for generated data sources · Issue #122 · php-perfect/ddev-intellij-plugin (github.com)).

Sadly I am not able to achieve this. My current code looks like this:

final TreePattern treePattern = new TreePattern(TreePatternUtils.create(ObjectName.NULL, ObjectKind.SCHEMA));
dataSource.setIntrospectionScope(treePattern);

Sadly this introspection scope does only scan the default schema.

Checking the generated dataSources.local.xml settings file for "All Schemas" it looks like I need a negative pattern.

      <schema-mapping>
  <introspection-scope>
          <node kind="schema" negative="1" />
        </introspection-scope>
      </schema-mapping>

I tried building TreePatternNode<TreePatternNode.NegativeNaming> instances, but without success.

Thanks in advance!

0
2 comments

Please try

return TreePatternUtils.importPattern(dbms ?: Dbms.UNKNOWN, ALL_NAMESPACES)
0

This code excerpt helped me a lot, thank you Yann Cebron!

0

Please sign in to leave a comment.