Giter VIP home page Giter VIP logo

cockpit-sql-driver's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cockpit-sql-driver's Issues

feature request: table prefix

Tables are created on the fly and this can mess things up.

Simple test:

$this->on('cockpit.bootstrap', function() {
    $test = $this->storage->getKey('test', 'test', []);
});

Now my database has a new table named "test".

Another test with an existing table:

$this->on('cockpit.bootstrap', function() {
    $test = $this->storage->getKey('wp_users', 'test', []);
});

result:

PDOException while running query
SELECT
"document"
FROM
`wp_users`
WHERE JSON_UNQUOTE(JSON_EXTRACT(`document`, '$.\"key\"')) = 'test'
LIMIT 1

The current behaviour makes it impossible to use the same database with a different application or with custom tables in it.

If I could prefix all cockpit tables with e. g. cp_, I could still create a ton of useles tables on the fly with a typo in my storage request, but it wouldn't hurt much.

default bootstrap prioritiy should be higher than 1

I'm not sure, if it was intentional, but the default bootstrap priority should be very high (e. g. 9999) to change the driver with the highest priority.

A simple test in addons/test/bootstrap.php:

// default priority 0
$this->on('cockpit.bootstrap', function() {
    $test = $this->storage->getKey('cockpit/options', 'multiplane', []);
    var_dump($test); // array(0) { } 
});

// priority 10
$this->on('cockpit.bootstrap', function() {
    $test = $this->storage->getKey('cockpit/options', 'multiplane', []);
    var_dump($test); // Call to a member function findOne() on null
}, 10);

If I set 'bootstrapPriority' => 9999 in the database options, the event with prio 10 works.

Addon not compatible with Cockpit v2

Hello i want to use cockpit with mysql database ,

How to install it ,
i have tryed it already buy its shown error ,
show please make a video on this in core cokpit .

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.