vim-dadbod-ui icon indicating copy to clipboard operation
vim-dadbod-ui copied to clipboard

Not drawing schema and tables on MSSQL Server (SQL Server) connections

Open juancarlis opened this issue 2 years ago • 1 comments

Can't see the schemas and table information when connecting on SQLServer databases.

I only get the errors attached on the image: image

Although I can execute queries without problems.

juancarlis avatar Aug 05 '22 14:08 juancarlis

Same with postgrr server somehow. no errors but no shemas, tables :(

caga avatar Sep 01 '22 10:09 caga

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 01 '22 15:10 stale[bot]

Needs further investigation

kristijanhusak avatar Oct 09 '22 14:10 kristijanhusak

I finally solved it by changing some keywords to upper case:

let s:sqlserver = {
      \   'args': ['-h-1', '-W', '-s', '|', '-Q'],
      \   'foreign_key_query': trim(s:sqlserver_foreign_keys_query),
      \   'schemes_query': 'SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA',
      \   'schemes_tables_query': 'SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES',
      \   'select_foreign_key_query': 'select * from %s.%s where %s = %s',
      \   'cell_line_number': 2,
      \   'cell_line_pattern': '^-\+.-\+',
      \   'parse_results': {results, min_len -> s:results_parser(results[0:-3], '|', min_len)},
      \   'quote': 0,
      \   'default_scheme': 'dbo',
      \ }

juancarlis avatar Oct 12 '22 15:10 juancarlis

I pushed this change now, thanks!

kristijanhusak avatar Oct 12 '22 16:10 kristijanhusak