kristijanhusak / vim-dadbod-ui

Simple UI for https://github.com/tpope/vim-dadbod
MIT License
1.48k stars 86 forks source link

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

Closed juancarlis closed 1 year ago

juancarlis commented 2 years ago

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.

caga commented 2 years ago

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

stale[bot] commented 2 years ago

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.

kristijanhusak commented 1 year ago

Needs further investigation

juancarlis commented 1 year ago

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',
      \ }
kristijanhusak commented 1 year ago

I pushed this change now, thanks!