Coder Social home page Coder Social logo

dbmanagr's People

Contributors

resamsel avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gschaden

dbmanagr's Issues

Exporter creates Update statements without PK-restriction

Even in the the simplest case, which means that I'm exporting only one table without references, the Exporter does not include a restriction in the update statement.

E.g. the given statement is:

update section set s_id = 3824, id = 131055131155, duration = 200, length = 600 [...] where ;

instead of

update section set id = 131055131155, duration = 200, length = 600 [...] where s_id=3824;

Exporter creates statements with NULL values only

When updating SQLAlchemy to a a version >= 1.0.8, dbexporter has NULL values only, in its generated statements.
The error can be mitigated by downgrading to an older version of SQLAlchemy.
The changelog (http://docs.sqlalchemy.org/en/latest/changelog/changelog_10.html) states that the query result class uses slots instead of dict now.
There are various locations throughout the code, where either dict is used, or at least these objects are treated as dictionaries.

dbexport with -D should delete in reverse order

The exporter should reverse the order of the delete statements, i.e. delete article before deleting user.

dbexport -D dbnav.sqlite/article?id=1 -i user_id

Actual

delete from "user" where id = 558;
delete from article where id = 1;

Expected

delete from article where id = 1;
delete from "user" where id = 558;

UTF-8 issue

Calling the following leads to an error:

dbnav skiline@localhost/skiline/spot?name~%nigs%

Error:

dbnav: 'ascii' codec can't encode character u'\xf6' in position 1: ordinal not in range(128)

Add Daemon Mode

Add a --daemon option that works similar to the Gradle --daemon option. The daemon should stay connected to the database for a few seconds or minutes, allowing to reuse the connection and gathered information from reflecting the database.

It could work that way:

When the option is set, use a separate DaemonDatabaseConnection (DDC) instead of the specific database connection. The DDC should then start the daemon (if not already running), connect to it, and use that daemon to execute the statements.

The daemon needs a separate writer that writes to a socket instead of stdout. It should also behave as a web server, the transport layer should be JSON (easy to debug with Postman, SoapUI, ...).

Cache result of expensive metadata retrieval

The part that takes longest in executing is retrieving metadata from the database. The result should be cached, and the cache should not expire.

Additionally, add a CLI parameter to refresh the cache (--refresh-cache, invalidates cache and forces reload of metadata), and another to disable caching at all (--disable-cache, does not invalidate cache).

dbexport throws ordinal not in range error

Using the YAML output fails for non ascii characters.

dbexport user@livecopy/database/competition?link_name=Swisscom_Snow_Cup -i competition_definition,competition_definition.competition_instance.safari_route_id.user_2_route -Y

Actual

dbexport: 'ascii' codec can't encode characters in position 47-48: ordinal not in range(128)

Expected

<YAML>

dbexec: 'str' object has no attribute 'close'

Command:

echo "update chip_number_to_external_id_mapping set valid_from = ski_date, valid_until = ski_date where valid_from is null and valid_until is null and ski_date is not null and ski_date < '2015-09-02';" | dbexec skiline@localhost/skiline_test

Result:

dbexec: 'str' object has no attribute 'close'

Expected:

Changed rows: 217326

allow placeholder for original value in -s

i would like to use placeholders in the -s option to reference the original value.

| id | name | value |
| 123456 | Berti Bauer | 3 |

-s value="myFunction('{value}')"

or even other column values:

-s value="myFunction('{id}')"

Improve error messages if no database connector is configured

Steps for reproduction:

  • Install on a system without python database connector(s) but existing postgres connection configuration (.pgpass)
  • execute dbexport user@connection/database/table
  • Error message is "Specify the complete URI to a table"

Error message should be: "It was not possible to connect to the database. If the connection is not among the following connections, please install connector (see [location of description]):
[list of connection]

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.