You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "Gerard Dellemann (Jira)" <ji...@apache.org> on 2019/09/16 08:20:00 UTC
[jira] [Commented] (METAMODEL-1219) Returning schemas for SQL
Server
[ https://issues.apache.org/jira/browse/METAMODEL-1219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16930318#comment-16930318 ]
Gerard Dellemann commented on METAMODEL-1219:
---------------------------------------------
The PR has been merged, the issue can be set to done?
> Returning schemas for SQL Server
> --------------------------------
>
> Key: METAMODEL-1219
> URL: https://issues.apache.org/jira/browse/METAMODEL-1219
> Project: Apache MetaModel
> Issue Type: Improvement
> Reporter: Gerard Dellemann
> Priority: Minor
>
> If you want a list of all schema's you call the DataContext#getSchemaNamesInternal() method. This method just asks for a lists of all schemas to the driver. With SQL Server users and schema's are highly connected. An empty datastore already has 13 default schemas. To avoid returning all these schemas being returned a special method was created: JdbcDataContext#getSchemaSQLServerNames(...), which first looks for all present tables and then gathers the schema's that belong to those tables. So if there are no tables, then there are also no schemas (to be exact: I now always get the 'sys' schema, which only contains tables and views which should probably considered part of the Information_schema, but let's not focus on that). For an end-user (e.g. a customer or tester of DataCleaner) this means that the default schema 'dbo' can be missed out of the list, even though it does exists. To create a table, we need a schema (see the JdbcCreateTableBuilder constructor). The only way the end-user can see the schema is by first manually (with e.g. MS SQL Server Management Studio) adding at least 1 table (or view) to the schema and then refreshing the list.
> For an end-user this is all very hard to understand, because he doesn't know this special code for SQL Server. Improving this code is chosing between evils. I would suggest either:
> # Remove this special code and just return all schemas like all the other datastores, by default this would result in a large list of schemas.
> # Keeping the current implementation, but checking if at the 'dbo' schema is present and then at least return that.
>
--
This message was sent by Atlassian Jira
(v8.3.2#803003)