Name people and projects in usage reports, and total a usage legend
The cluster page's usage table showed session:usr-... and proj-... ids; it now shows the person's email, whether it came through a key or the chat page, and the project's path or "personal". Times read "3 hours ago" rather than "3h7m25s ago", everywhere. The usage page's legend gave each line's latest slice, which was 0 beside a table of hundreds; it gives the window's total, and the table's numbers are right-aligned like everywhere else. The PostgreSQL placeholder rewriting skips line comments. An apostrophe in one opened a string that swallowed every placeholder after it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ff86e52126
commit
9b663eb23c
10 files changed
+180
-33
No files matched your search
@@ -42,3 +42,17 @@ func TestAQueryWithNoPlaceholdersIsUntouched(t *testing.T) {
|
||||
t.Errorf("rebind = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestACommentDoesNotOpenAString(t *testing.T) {
|
||||
// An apostrophe in a comment is not a quote. Read as one, it swallowed
|
||||
// every placeholder after it.
|
||||
got := PostgresDialect.rebind("SELECT a -- the key's owner\nFROM t WHERE x = ? AND y = ?")
|
||||
want := "SELECT a -- the key's owner\nFROM t WHERE x = $1 AND y = $2"
|
||||
if got != want {
|
||||
t.Errorf("got %q", got)
|
||||
}
|
||||
// A comment's own question mark is not a placeholder either.
|
||||
if got := PostgresDialect.rebind("SELECT 1 -- why?\nWHERE x = ?"); got != "SELECT 1 -- why?\nWHERE x = $1" {
|
||||
t.Errorf("got %q", got)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user