Schema Picker / Schema Selector in DataGrip 2018.3.1 using SQL Server (on Mac OSX)

已回答

First of all, the About DataGrip info:

DataGrip 2018.3.1
Build #DB-183.4886.38, built on December 17, 2018
...
JRE: 1.8.0_152-release-1343-b26 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6

I have a simple problem.  I'm trying to change current schema because I am not using dbo.  This is what I see when right-clicking the schema-> Database Tools -> Manage Shown Schemas:

I did a lot of digging and found that there is supposed to be a schema picker at the top right of any console.  For me, it appears as database picker only (schemas are not shown).

This is what I expect to see, something like:

(As shown here, for DataGrip 2017: https://blog.jetbrains.com/datagrip/2017/03/22/datagrip-2017-1-released/#console )

But for me, it only has table picker (schemas are not shown):

I also already tried a couple things like going to the properties of the datasource and selecting the Schemas tab. There is pattern matching available there for the shown schemas in the tree, but other than that I can see what is assigned as "Current Schema" (which is dbo), but can't change the assignment.

I then tried also within properties the Options tab, which has a "Switch schema" property, which was set to Automatic. I changed it to Manual, applied the change and still no difference.  Is there something simple I am missing here? Appreciate the attention.

Thank you.

--Nick

1

For MS SQL:
"Database chooser" selects the context for query execution. In MS SQL it is a database. You need qualify objects with schema if it differs from the default one.

"Current schema" - IDE shows you default user schema.

See:
https://www.mssqltips.com/sqlservertip/4036/default-schema-for-windows-group-in-sql-server/
https://stackoverflow.com/questions/3806245/sql-server-schema-and-default-schema

For PostgreSQL:
"Schema chooser" sets search path.

0

I see.  So we can set the default schema for a certain domain / group that is set up to use it, either with a

ALTER USER [Domain\GroupName] WITH DEFAULT_SCHEMA=[dbo]

query and, please correct me if I am wrong, there is no way to change it in DataGrip's GUI. I was misunderstanding - I thought DataGrip had an IDE-level schema picker, which would automatically qualify objects with that schema for the ones I am not qualifying with a schema spec when typing out new queries, essentially being a default schema for the DataGrip session and not actually setting it for the domain / group.  I think that would be a great feature.

Thank you for your help!

0

请先登录再写评论。