Code Monkey home page Code Monkey logo

Comments (29)

glepnir avatar glepnir commented on May 22, 2024

Hi @kristijanhusak any update for this issue?

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir I'll look into this. Did you try declaring different formats to see if it works?
For example, try something like this to see if you get the same results:

  let g:dbs = [
  \ { 'name': 'jianshu', 'url': 'mysql://root@localhost/jianshu' }
  \ { 'name': 'ginweb', 'url': 'mysql://root@localhost/ginweb' },
  \ ]

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

@kristijanhusak I already tried it. the result is same.

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir as far as I know, in MySQL, all databases belong to the same schema. From your screenshot, I see both databases in both connections.
How would you expect it to work?

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

@kristijanhusak you can see the crawler and ginweb both connect to mysql db. not ginweb database

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

I tried the dadbod DB mysql://root@localhost/ginweb. it's only connect to ginweb database.

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir all mysql databases belong to mysql db, that's why you see them in both connections.
Schemas are fetched from this query:

SELECT schema_name FROM information_schema.schemata

What would you expect to see in "Schemas" when you connect to specific database?

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

To be honest, this statement is correct. It will return all databases in mysql。But just like the connected url. We want to connect to a certain database.Any current mysql connection url returns the entire mysql database.
This is strange. Why do we need to specify a certain database in the URL? Even if it is specified, it loses meaning. Because we still see all the databases in mysql.

ginweb: mysql://root@localhost/ginweb  same as mysql:mysql@localhost/mysql
crawler: mysql://root@localhost/crawler  same as mysql:mysql@localhost/mysql

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir I don't think you have to. Doing mysql://root@localhost should be enough.

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

Ok. But this is not important. What I want to say is that even if we connect to the specified database through the URL, the result is still the entire mysql database.

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir Yes, that's true. That's why I ask, what would you expect to be listed under 'Schemas' in drawer when you are connected to specific database?

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

Obviously I only want to see information about this database. Maybe like this? ginweb: mysql://root@localhost/ginweb
image

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

It looks like we need to query the views functions tables from schemes. I don't know the specific implementation. If we can't achieve it. I think we need to modify the readme and doc to remind other users. Any URL in mysql will return the entire mysql database. To avoid more trouble

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir pull latest and give it a test.
It should print out whole mysql db only if url doesn't have specified db (mysql://root@localhost).
If db is specified, it should show only tables.

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

It looks good, but can there be 2 tables hidden?
image

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

Can you give me output of this:

:echo db#adapter#mysql#tables('mysql://root@localhost/ginweb')

I want to see what's that warning.

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

Here is warning.
image

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir I edited my comment. I initially added the password for root. Do this:

:echo db#adapter#mysql#tables('mysql://root@localhost/ginweb')

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

Can you give me output of this:

:echo db#adapter#mysql#tables('mysql://root@localhost/ginweb')

I want to see what's that warning.

:echo db#adapter#mysql#tables('mysql://root@localhost/ginweb') this command same as pre command? The output is same as pic ? Do i need update the dadbod-ui?

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir put whatever you put for url in dadbod-ui.
From screenshot it looks like you provided a password for root, but you are not using any password.
If you are using password for root, do it like this:

:echo db#adapter#mysql#tables('mysql://root:YOURPASSWORD@localhost/ginweb')

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

Got it .
image

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir pull latest changes and give it a test.

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

Does not hidden this in latest version?
image

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir sorry, I don't get the warning, so I can't test it properly. Regex was wrong. Pull and test again.

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

It still exist.

call filter(a:db.tables.list, 'v:val !~? "^mysql: \[Warning\]" && v:val !~? "^Tables_in_"')

What about this?

let a:db.tables.list = a:db.tables.list[2:len(a:db.tables.list)-1]

image

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

I create a pr for this. please check thanks.

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir it will not work. I wrote on PR why. Try to go to line 524 in drawer.vim and tweak the filtering.

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

@glepnir pull now and test. Closing square bracket wasn't escaped properly.

from vim-dadbod-ui.

glepnir avatar glepnir commented on May 22, 2024

closed.

from vim-dadbod-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.