Storm's DEBUG mode should include the database URI when outputting queries

Bug #156807 reported by Jamu Kakar
2
Affects Status Importance Assigned to Milestone
Storm
Won't Fix
Low
Jamu Kakar

Bug Description

Today while debugging a problem it seemed that two identical queries
were being run. Eventually it was determined that they were running
against different databases. It would be nice if the output generated
when storm.database.DEBUG is True included the URI of the database the
query is being run against.

Related branches

Revision history for this message
Jamu Kakar (jkakar) wrote :

The branch attached to this bug is ready for review. It introduces
the following changes:

- Store and Database objects have a uri property that exposes the URI
  object they use.

- URI objects represent themselves in the standard textual format when
  stringified.

- The URI is included in statement output when storm.database.DEBUG is
  True.

Changed in storm:
assignee: nobody → jkakar
importance: Undecided → Low
status: New → In Progress
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Nice idea! I'd like to use these ideas on execution tracing that I'm working on.
OTOH, there are a few issues with this branch, so rather than trying to integrate
it on trunk, I'll just move it forward.

Specific issues I've noticed:

[1]

The port parameter handling in URI.__str__ is untested, and will break the
method if passed, because it's an integer.

[2]

There's no escaping handling in URI.__str__.

[3]

If only the password is passed in, the uri produced is broken because '@' isn't
added between the password and the hostname.

[4]

If the host part isn't provided, the uri is broken because '@' isn't added after the
username and/or password.

[5]

I think we should expose store.database instead of store.database.uri as store.uri
directly.

[6]

Rather than having all database backends setting self.uri = uri, we should have a
common constructor in Database.__init__ which does it.

Revision history for this message
Jamu Kakar (jkakar) wrote :

Gustavo's taking the useful bits from here and integrating them in his
tracing branch.

Changed in storm:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.