| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| | |
Teal thinks that these are key-value maps which are always of length
zero, but that is not the case.
|
| |
| |
| |
| | |
These are gathered into arrays
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The :execute method is mainly used for one-off queries such as creating
tables and indices. There is no need to cache this prepared statement,
as those queries are only done on startup.
Further, prepared statements can't be reused without being reset, so
this was likely broken anyway.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There were 3 very similar methods:
- :execute()
- :execute_query()
- :execute_update()
The first one returns the prepared statement and is mainly used
internally in the library for CREATE statements.
The later two only really differ in how the results are returned.
Those two are one main method and one small one that only picks out the
iterator.
|
| | |
|
|\| |
|
| |
| |
| |
| |
| |
| | |
For consistency with other utils.
Consistency is good.
|
| |
| |
| |
| |
| | |
Instead of storing (start, length) tuples, store the offset to the end
of items and derive length using the previous entry.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Index file contains offsets and lengths of each item() which allows
seeking directly to each item and reading it without parsing the entire
file.
Also allows tricks like binary search, assuming items have some defined
order.
We take advantage of the 1-based indexing in tables to store a magic
header in the 0 position, so that table index 1 ends up at file index 1.
|
| |
| |
| |
| |
| | |
This is the config I want 90% of the time when just showing data in the
console or so.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Standardized and structured replacement for the X-Forwarded-For,
X-Forwarded-Proto set of headers.
Notably, this allows per-hop protocol information, unlike
X-Forwarded-Proto which is always a single value for some reason.
|
| |
| |
| |
| | |
Backs out 895a82c5d8d4 beacuse __freeze already added in a96a2fbcc6c0
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Where gethostname or tohostname returns an invalid name, e.g. containing
underscores or something, to_ascii would reject this and return nil,
which triggers an error in the dns lookup.
Reported by prova2 in the chat, for whom tohostname returned a long name
containing underscores.
|
| |
| |
| |
| |
| | |
Useful to have this info available when juggling metrics, e.g. to
see if things changed between versions.
|
| |
| |
| |
| | |
Module was removed in 0.8.0 in c52b06de9b27
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Rationale: See diffstat
When this module is imported, it ends up calling stty via term_width()
in util.human.io.table(). When this happens outside of a terminal, the
following message is sent to stdout:
stty: 'standard input': Inappropriate ioctl for device
Not importing this module avoids that.
Furthermore three is value in this module having minimal dependencies as
they might not be available when it does the checks.
Ref a1fed82c44b9
|
| |
| |
| |
| |
| | |
Previously the kvsep before and after the kvpairs would have been
included in kvpairs, which is incorrect but should be harmless.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Like 'pattern' but uses Lua patterns instead of Regular Expressions,
since only a subset of regex are also valid Lua patterns.
|
| |
| |
| |
| |
| |
| |
| |
| | |
'patternProperties'
Previous version of this patch used 'patternProperties' but that would
only work with simpler ECMA-262 regular expressions are also valid Lua
patterns.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Error stanzas should have an <error> element, but if you pass a
stanza without one to util.error.from_stanza() it triggers an attempt to
index a nil value, which this patch avoids.
In the conditional, it should be safe to assume error_tag is non-nil
since condition can't have those values then.
|
| |
| |
| |
| |
| |
| | |
Fixes that the more fixed width columns there are, the narrower the
resulting table becomes. A right-aligned variable-width column at the
last position should always be flush to the right side of the terminal.
|
| |
| |
| |
| |
| | |
Can happen if you resize the terminal too narrow that the space left for
variable width columns end up negative.
|
| |
| |
| |
| |
| | |
Thanks timeless, your mere existence inspires us to improve our
spelling, tho this was more syntax.
|
| |
| |
| |
| | |
A review of existing code suggests nothing will break. So, here we go...
|
| |
| |
| |
| |
| | |
Similar logic occurs throughout various modules in the codebase. We might even
want a module:get_option_duration()??
|
| |
| |
| |
| |
| | |
E.g. when you do 'prosodyctl shell "s2s:show()"', this is the case that
triggers, and it was missing the @width argument, causing confusion.
|
| |
| |
| |
| | |
os.getenv() returns a string but term_width() should return a number
|
| |
| |
| |
| | |
Fixes invalid attribute value: expected string, got number
|
| |
| |
| |
| | |
...which now reads $COLUMNS for us and does the right thing.
|
| |
| |
| |
| |
| | |
This allows callers to adjust other things based on the width of the rows
(such as header lines).
|
| |
| |
| |
| |
| |
| | |
readline)
Feels like it should be faster.
|
| |
| |
| |
| |
| | |
Kicks in if/when readline hasn't set $COLUMNS, e.g. when using the
`prosodyctl shell command like this` form.
|
| | |
|
| |
| |
| |
| |
| | |
This is not standard POSIX, but apparently very widely supported. For
reference: https://www.austingroupbugs.net/view.php?id=1053
|
| |
| |
| |
| |
| |
| | |
I forget why I wanted this, but it may allow doing things like pull
settings from the column, especially when the mapper function is reused
among many columns.
|
| |
| |
| |
| |
| |
| | |
As an alternative to doing it in the mapper function. Could be useful in
cases where one may want to put the ellipsis in the middle or beginning
instead of the start.
|
| |
| |
| |
| |
| | |
In order to allow it to adjust its output to available space, apply its
own ellipsis method or other compacting method.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Makes it easier to make out where the set starts and ends in cases where
it may get embedded and tostring()-ed in a log message.
{ } taken over from util.array for consistency with some other systems
syntax for Sets, e.g. Python
|
| |
| |
| |
| |
| |
| |
| | |
Arrays in Lua do use { } but since __tostring is often user-facing it
seems sensible to use [ ] instead for consistency with many other
systems; as well as to allow the {a,b,c} formatting to be used by
util.set without being confused with util.array.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of a percentage, this allows you to specify e.g. `width="[N]p"`, where
a width="2p" will be twice the width of a width="1p" column.
Compatibility with the old %-based widths is preserved, and percentages adding
up to more than 100 are handled more gracefully.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
To avoid a race where server-started fires before the promise function body is
run (on next tick), I moved server-started to fire on the next tick, which
seems sensible anyway.
Errors are logged, I'm not sure if we ought to be doing something more here.
I'm sure we'll find out.
|
| | |
|
| |
| |
| |
| |
| | |
If this object key exists then this schema must validate against the
current object. Seems useful.
|
| |
| |
| |
| | |
If this field exists, then these fields must also exist.
|