Giter Site home page Giter Site logo

Comments (4)

kiwanami avatar kiwanami commented on July 28, 2024

OK, I'll show you code later.

Well, do you use history list?

from emacs-edbi.

mattsears avatar mattsears commented on July 28, 2024

Thank you! I was hoping I can open the Database View with code so that I can automatically open the database for a given project (ie Ruby on Rails) I am working in.

So in code, I want to determine the project root, find the database connection settings, and launch the Database View given the database info found in the database setting files.

Thanks again for your help.

from emacs-edbi.

kiwanami avatar kiwanami commented on July 28, 2024

Here is a direct open code:

(defun edbi:open-db-viewer-with-info (uri &optional user auth)
  "Open Database viewer buffer with data source info."
  (let ((data-source (edbi:data-source uri user auth)) 
        (conn (edbi:start)))
    (edbi:connect conn data-source)
    (edbi:dbview-open conn)))

usage:

(edbi:open-db-viewer-with-info "dbi:Pg:dbname=xxxx" "username" "password")

Your idea sounds good. We usually open DB views for the project specific database.
The setting or parsing configuration file may be difficult to implement completely.
So, I think remembering the pair info between the project root directory and data source is reasonable to use generally.

from emacs-edbi.

mattsears avatar mattsears commented on July 28, 2024

Great! That is exactly what I was looking for. Thanks!

from emacs-edbi.

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.