Qore Programming Language Reference Manual
0.9.0
|
lang
info was added to the result string if availablewarning_mask
parameterlang
programid
statementid
lang
"Dn"
and "DN"
: the ordinal day number in the year"I"
: ISO-8601 week string"Id"
and "ID"
: ISO-8601 week day number"IF"
: the value in ISO-8601 format for both relative (ex: "P2Y1M3DT5H7M9.002S"
) and absolute dates (ex: "2018-03-23T10:43:12.067628+01:00"
)"Iw"
and "IW"
: ISO-8601 week number"Iy"
and "IY"
: ISO-8601 week yearAbstractConnection::getConstructorInfo()
method (and supporting declarations) was added to allow connections to be created dynamically, potentially in another process from a network call (issue 2628)AbstractConnection
has new public flag enabled
. Also constructors are updated. (issue 3001)AbstractConnection
has new constructors, old ones are obsolete. Custom URL/URI parsing is possible (issue 3162)AbstractCsvIterator::getRawLine()
and AbstractCsvIterator::getRawLineValues()
(issue 2739)AbstractTable
objects (issue 2663)"header-info"
hash to the context argument when calling handlers (issue 3260)HttpServer::addHttpMethod()
method (issue 2805)AbstractTable
objects (issue 2663)AbstractTable
objects (issue 2663)AbstractTable
objects (issue 2663)RestHandler::returnRestException()
method that allows subclasses to determine how exceptions are handled (issue 3235)"PUT path/xxx"
can be used instead of "PUT path?action=xxx"
(issue 2994)AbstractTable::getRowIterator()
for AbstractTable::getStatement()
(issue 2326)AbstractTable
objects (issue 2663)parse_ranges()
(issue 2438)check_ip_address()
(issue 2483)parse_to_qore_value()
to support single-element lists and hashes with curly brackets including empty hashes (issue 3138)lang
value (issue 3182)"Run to statement"
implementationstd::string
in GNU libdstdc++ 6+ (issue 3179)jni
) with per-program private data would fail (issue 3024)public
and private
members of classes inherited with private:internal
inheritance were not initialized when objects were created (issue 2970),304 Not Modified
responses in the HTTPClient class (issue 3116)HEAD
requests and others) (issue 3116)PORT
operations would not time out (issue 3031)"Content-Encoding"
value were received by the HTTPClient class (issue 2953)qpp
(used in building Qore from source) (issue 2838)PING
messages to be customized (issue 2887)number_format
option to allow numbers with alternative decimal separators to be parsed and generated (issue 2806)"bin"
serialization method (issue 2816)"text"
serialization with binary message bodies (issue 2816)mime_parse_form_urlencoded_string()
where repeated elements would be overwriteen by subsequent keys with the same name (issue 2761)csvutil_set_global_compat_force_empty_string()
function and the compat_force_empty_string
CSV parsing option to force "*string"
fields with no value to return an empty string when parsing rather than NOTHING for backwards compatibility with very early versions of CsvUtil (issue 2476)AbstractTable::getRowIteratorNoExec()
method (issue 2773)RawSqlStatementOutboundMapper
to be usable without subclassing (issue 2775)onAttach()
event is now executed synchronously when the program thread context startsonDetach()
event is executed properly when program thread contexts terminateonStep()
now provides the breakpointId
value if availableonExit()
event was added for greater control over code execution in the debuggeronException()
event was improvedframeid
as a parameterCREATE MATERIALIZED VIEW
grant the table backing the view is created but the materialized view itself is not created causing future creation actions to fail (issue 2643)()
and an empty hash {}
could not be assigned to complex types, leading to excess typing and casting for simple operations (issue 2647)Z
placeholder to always output the UTC offset as documented (issue 2684)"thread list"
, "backtrace all"
commands implemented for the debugger (issue 2608)testAssertionValue()
method to support auto/number/float and more verbose output when a difference in number/float values is found (issue 2556)cop_value()
(issue 2555)WebSocketClient::pong()
to allow unsolicited PONG
messages to be sent (issue 2566)PONG
messages caused the connection to be prematurely closed (issue 2566)HASHDECL-IMPLICIT-CONSTRUCTION-ERROR
exception is raised in such cases (issue 2491)qdbg-remote
where wss://
schemes were not accepted (issue 2596)sqlutil
script has been updated with the –select
option to allow dumped table rows to be filtered (issue 2509)astparser
module fixes:AstParser::parseFile()
and AstParser::parseString()
methods (issue 2261)Message::addBody()
with no body present (issue issue 2360)STRING-TOO-LONG
exception (issue 2405)Test::assertRegex()
Test::assertNRegex()
Test::assertNeq()
Test::assertNeqSoft()
Test::assertGt()
Test::assertGtSoft()
Test::assertGe()
Test::assertGeSoft()
Test::assertLt()
Test::assertLtSoft()
Test::assertLe()
Test::assertLeSoft()
Test::assertNothing()
AbstractRestSchemaValidator::parseRequest()
to reflect how validation exceptions should be raised for proper error reporting (issue 2344)500 Internal Server Error
response to be returned instead of a 400 Bad Request
error (issue 2397)qpp
generating hashdecl code in a specific namespace (issue 2255)q_absolute_path_windows
to correctly recognize relative Windows paths beginning with a drive letter (issue 2377)private:internal
in method execution within a class hierarchy in some cases (issue 2380)qdbg
to resume any blocked threads before exiting to ensure a clean and correct shutdown of the debugger; fixes a problem when the process ould freeze on quit
(issue 2472)synchronized
functions have a global reentrant lock associated with the function (as in previous versions of Qore), whereas now synchronized
normal class methods share a reentrant lock associated with the object, while synchronized
static class methods share a reentrant lock associated with the class itself. This aligns Qore's synchronized behavior with that of Java and [MethodImpl(MethodImplOptions.Synchronized)]
.NET/CLR (issue 894)."auto"
due to the introduction of this identifier as a special type nameprivate:internal
(providing strong encapsulation of the following declaration(s)) and private:hierarchy
(which is equivalent to private
; issue 1197)ssl_cert_path:
allows an X.509 client certificate to be set in the constructorssl_key_path:
allows a private key for an X.509 client certificate to be set in the constructorssl_key_password:
allows a password-protected private key to be used wih an X.509 client certificatessl_verify_cert:
enforces server certificate validation with HTTPS connectionsPATCH
method (RFC 5789)AbstractBulkOperation::size()
methodFixedLengthFileIterator::getFileName()
(issue 1164)parse_uri_query()
function was moved to the Util moduleMimeTypeMultipartFormData
MimeTypeMultipartRelated
MimeTypeMultipartMixed
MultipartMessage::getBoundary()
MultipartMessage::serializeBody()
MultipartMessage::size()
Pop3Connection
class to support the ConnectionProvider moduleqorize_named()
added support for objectsRestConnection
class to support the ConnectionProvider moduletext/plain
Content-Type
"swagger"
options using the Swagger module in the RestClient
and RestConnection
classesSalesforcRestConnection
class to support the ConnectionProvider modulec_blob()
and c_clob()
functions (issue 1851)SmtpConnection
class to support the ConnectionProvider modulecop_trunc_date()
function (issue 2032)InboundTableMapper
(issue 1067)InboundTableMapper::queueData(list)
TelnetConnection
class to support the ConnectionProvider moduleTelnetClient::getTarget()
methodparse_uri_query()
function was moved here from the HttpServerUtil moduleparse_uri_query()
now handles repeated query arguments as a listflatten()
uniq()
WebSocketConnectionObject
class to support the ConnectionProvider moduleWebSocketClient
class did not validate the Sec-WebSocket-Accept
response header according to RFC6455 (issue 2062)ws_get_response_key()
functionAbstractAuthenticator::do401()
was ignored (issue 1047)UTF-16
fixes:UTF-16
encodings (issue 1579)UTF-16
encodings (issue 1586)UTF-16
encodings (issue 1775)MPFR_DECL_INIT()
is compiled incorrectly with -O1 or greater (issue 958)char
is the same as signed char
(issue 1385)SqlUtil::BLOB
type in the FreetdsSqlUtil module (issue 1852)"$"
signs even when %allow-bare-refs was not in effect (issue 1941)getaddrinfo(3)
and getnameinfo(3)
internally instead of the deprecated gethostbyname(3)
and gethostbyaddr(3)
(issue 1952)argv
in base class constructor execution (issue 2030)"action"
key was only removed from the ah
hash when there were no other arguments, introducing an inconsistency in argument handling in REST services (issue 2479)ENCODING-CONVERSION-ERROR
exceptions were not thrown with newer GNU iconv libraries with an API change (issue 2500)comment
for a table column (issue 1886)offset
query hash argument in SQL operation methods (issue 1880)InboundTableMapper
class (issue 1849)SQLSTATEMENT-ERROR
exception (issue 1836)allow_dot
and allow_output_dot
options (issue 1690)TableMapper
bugs introduced in Qore 0.8.12.7 (issue 1754)character_semantics
for standalone column (issue 1688)InboundTableMapper::queueData()
(issue 1736, bug introduced in Qore 0.8.12.7 with the fix for issue 1626)size_t
arguments that could cause invalid data to be output or crashes on 32-bit platforms (issue 1640)InboundTableMapper::queueData()
performance (in the TableMapper module) when used with data in hash of lists format to use bulk DML in input and output without internal data conversions (issue 1626)ORA-22165
from op_in()
caused by Oracle's limit on number of collection elements (issue 1660)init
and del
attributes in user module headers (issue 1535)static
and abstract
(issue 1590)BulkInsertOperation
class in the BulkSqlUtil module where inserts would fail or silently insert invalid data in the second or later blocks when constant hashes were used (issue 1625)"rawxml"
message body encoding (issue 1437@inf@
on Windows (issue 1442)Host
header in HTTP requests to not include the port if the port is the default port for the scheme because it causes some servers to reject the request (issue 1489)AbstractCsvIterator::identifyTypeImpl()
generating an error message (issue 1355)Message::attach()
(issue issue 1352)cop_length()
column function (issue 1395)TableMapper::SqlStatementMapperIterator
from TableMapper::AbstractSqlStatementOutboundMapper::iterator()
(issue 1418)TableMapper::AbstractSqlStatementOutboundMapper::getRowIterator()
TableMapper::InboundTableMapper::iterator()
TableMapper::InboundTableMapperIterator::getRuntime()
TableMapper::InboundTableMapperIterator::replaceRuntime()
TableMapper::InboundTableMapperIterator::setRuntime()
TableMapper::SqlStatementMapperIterator::getRuntime()
TableMapper::SqlStatementMapperIterator::replaceRuntime()
TableMapper::SqlStatementMapperIterator::setRuntime()
size = 0
where NOTHING could be returned which is invalid according to the methods' declared return types (issue 1260)SqlStatementOutboundMapper::iterator()
method; corrected the iterator object return value which was causing AbstractMapperIterator::mapBulk()
to fail (issue 979)SqlStatementOutboundMapper
; it would throw an error if the required "table"
or "sh"
options were used and only worked with subclasses that declared these options (issue 981)AbstractSqlStatementOutboundMapper::iterator()
failed to use options when creating the new Mapper
object (issue 1088)self
in base class constructor arguments (issue 1169)copy()
method as synchronized would result in a crash when the method was called (issue 1188)list l = 1, 2, 3;
were valid assignments. Due to operator precedence, such statements should normally be interpreted as (list l = 1), 2, 3;
, which is not a valid expression. Not only were the rules applied with only some assignment operators, but such lists were only rewritten if used as top-level statements, therefore the rules were applied inconsistenctly depending on where the expression was located in the parse tree. As of Qore 0.8.12, these inconsistencies have been eliminated by default from Qore; all lists are processed according to the precedence rules defined in Operators. This could break old code that relied on the old, broken behavior. To get the old behavior, use the %broken-list-parsing parse directive."_"
; the following is now a valid (with %new-style):{}
; for example:SOCKET-THROUGHPUT-WARNING
event is no longer raised on the warning queue if the transfer size is less than 1024 bytes; this affects:
%requires(reexport)
form of the %requires parse directive."tolwr"
option in structured text parsing classesAbstractCsvWriter
will set "headers"
from the "fields"
option if "headers"
are not explicitly setCsvStringWriter
class for API compatibility with the corresponding FixedLengthDataWriter methodsAbstractCsvWriter::write()
quote_escape
option implemented in AbstractCsvWriter
"datamap"
and "info_log"
options for CSV generationAbstractCsvWriter
and AbstractCsvIterator
using resolve_type
and headers
options"constant"
field tag, allowing a constant value for an output field to be specified directly in the mapper hash"default"
field tag, giving a default value if no input value is specified"date_format"
mapper option"number_format"
mapper options"number"
field type: now leaves numeric values in their original type, converts all other types to a number"crec"
option"input"
option with input record validation"output"
option with output record validation"info_log"
option and removed the "trunc"
option"runtime"
field tag"index"
field tag"returning"
clause in insert statements; now such inserts are made in a single round trip instead of n + 1 where n is the number of sequences in the insertunstable_input:
to accommodate unstable input data and disable the insert optimization (default: False)insert_block:
for DB drivers supporting bulk DML, the number of rows inserted at once (default: 500, only used when unstable_input
is False) and bulk inserts are supported in the table object"+"
(plus) to " "
(space) in the query portion of URIs in parse_uri_query()"ssl"
key to the listener socket info hashroot_path
to the context hash if the path was matched by a URL path prefix (issue 570)"returning"
clause in supported drivers to avoid server round trips"desc"
keyword in orderby expressions"wop_or()"
function to allow complex SQL expressions to be generated with "or"
as well as "and"
"cop_cast()"
operator for converting [column] value into another datatype"cop_sum()"
aggregate operator for returning sum of column values"uop_plus()"
, "uop_minus()"
, "uop_multiply()"
, "uop_divide()"
"cop_coalesce()"
column operation function to support the "COALESCE"
operator in queries (issue 671)cop_substr()
and uop_substr()
operators (issue 801)op_substr()
where operator (issue 883)"omit_update"
upsert option for asymmetrical upserts (updates only update a subset of the columns inserted) (issue 791)"UpsertUpdateOnly"
upsert option (issue 793)bool
, float
, int
, timetz
, timestamptz
, varbit
binary
, varbinary
glob_to_regex()
lpad()
and rpad()
ordinal()
plural()
regex_escape()
zip()
parse_to_qore_value()
now respects parentheses when parsing lists and hashes (issue 846)QDBI_METHOD_ABORT_TRANSACTION_START
DBI method; transactions are always assumed to be in progress even if an exec call throws an exception in the first statement in a new transaction; this is necessary to handle bulk DML where a single statement can partially succeed and partially fail; the ABI remains unchanged; drivers that set this DBI method will no longer have it called because it's not necessary; in the upcoming API/ABI change this C++ DBI method will be removed entirelyGetDiskFreeSpaceEx()
issue 618)HttpServer::http_get_url_from_bind()
(issue 821)"/"
chars were sometimes present in the request URI path"/"
char was sometimes added to the request URI path (issue 899)"format"
field option was not usable with fields assigned type "*date"
UpsertSelectFirst
which means that insert-only reference data could also be updated"desc"
string was added only to the last column but should have been added to all columns"op_in()"
where invalid SQL was generated with an argument of 0 (issue 500)cop_seq()
and cop_seq_currval()
(issue 624)join_inner()
where the cond argument was ignored (issue 645)"uop_lower()"
and "uop_upper()"
operators to allow nesting (issue 657)AbstractTable::update()
with sequence operators (issue 942)cop_seq()
and cop_seq_currval()
(issue 624)"begin"
call to make the savepoint work with PostgreSQL 9.3+ servers"time"
columns; they were being issued as "time6"
instead of "time(6)" (issue 385)"bit"
, "bit varying"
, "char"
, "character"
, "character varying"
, "char varying"
, "oid"
, "varchar"
cop_seq()
and cop_seq_currval()
(issue 624)varbinary
type (issue 403)binary
type (issue 524)schema
member incorrectly set by AbstractDatasource::getUserName() instead of AbstractDatasource::getDBName() (issue 519)FileHandler::tryServeRequest()
where index files could be incorrectly served with a "204 No Content"
response (issue 616)SOCKET-NOT-OPEN
errors when closing (server already closed the connection)AbstractRestStreamRequestHandler
object so they can be properly logged (issue 734)"/"
chars were handled incorrectly (issue 900)normalize_dir_windows()
handling of UNC paths (issue 813)%n
, %N
, or %y
could be added to another string with a different character encoding without any automatic conversions, therefore resulting in an improperly-encoded stringContent-Encoding
header would cause a crash737.38.toNumber() -> 737.3799999999999954525264911353588104248
&
(ampersand) characters were not recognized as shell meta-charactersfork(2)
, enables all signals, and calls execl("/bin/sh", "sh", "-c",
command, 0)
in the child process (on UNIX systems; on Windows, system(3) is used directly as before)SIGCHLD
was blocked by default which caused deadlocks when spawning child processes that in turn waited on grandchild processes - now Qore no longer blocks SIGCHLD
on UNIX platforms1970-01-01Z
), and a relative date/time value is producedselect(2)
was called after EINTR
without reinitializing the descriptor array argument (issue 435)FD_SETSIZE
(issue 436)Content-Length: 0
was returned (or if no Content-Length
header was returned at all) which would result in a deadlock until the server would close the connection (issue 434)"."
by default (issue 660)"\*"
or "/*"
(issue 664)RUNTIME-TYPE-ERROR
exception (issue 683)SOCKET-SEND-ERROR
thrown when the remote end closes the socket during the transfer (issue 691)'$'
character in a regular expression substitution target string (issue 777)"::"
) with Qore::parse_url() (issue 822)CALL-WITH-TYPE-ERROR
exceptions were thrown based on the parse options in the caller instead of in the target when calling across a Program barrier (issue 841)copy()
method argument parsing; compatible type declarations were not accepted (issue 946)"filename"
key when run in a Program context with Qore::PO_NO_EXTERNAL_INFO set"forupdate"
select option"write-headers"
option to AbstractCsvWriter
and subclasses to enable headers to be suppressed"optimal-quotes"
option to AbstractCsvWriter
and subclasses to enable more efficient csv output (now the default)"columns"
entry but where column names were otherwise requiredCsvAbstractIterator:
base abstract iterator class for iterating line-based CSV dataCsvDataIterator:
iterator class allowing for CSV string data to be processed line by line on a record basisAbstractCsvWriter:
a base class for new CSV writer implementationsCsvFileWriter:
CSV file writer classCsvStringWriter:
CSV in memory writer class"headers"
in the constructor if "fields"
are set; headers are assumed to be the field labels in the same orderContent-Type
request header when sending stringsAccept
header correctly in requests (previously only indicated yaml ("text/x-yaml"
) as an acceptible response encoding)OPTIONS
method"Bad Request"
error if an unsupported HTTP method is used in a REST CallUpsertInsertOnly
upsert strategy to SqlUtil"application/wsdl+xml"
)"xls"
and "xlst"
extensions to MimeTypeXml"response-code"
key of the info output hash could be missing in some cases (issue 3237)Connection
, Content-Encoding
, Transfer-Encoding
, Location
, or Content-Type
headers are received"\0441"
where the "1"
would cause an error)"date"
field handling with empty input (now maps to 1970-01-01)'%'
was not handled correctly in all cases"name"
and optionally "link"
keys for symbolic links; additionally symbolic links are now followed and files and directories are differentiated based on their targets when processing symbolic linksg
specifier to extract all occurrences of the pattern(s) in a string; also regex_extract() and <string>::regexExtract(string, int) now accept Qore::RE_Global to extract all occurrences of the pattern(s) in a string"%y"
format specifier now produces YAML-like output for the binary valueSOCKET-CLOSED
exception was not thrown when the remote end closed the connection"/"
REFERENCE-ERROR
exception is thrownPO_INHERIT_USER_FUNC_VARIANTS
is now: PO_NO_INHERIT_USER_FUNC_VARIANTSPO_INHERIT_GLOBAL_VARS
is now: PO_NO_INHERIT_GLOBAL_VARSsource
and offset
information is present"source"
and "offset"
added for parse and runtime exceptions to allow for error-reporting to display information about files where sections of a source file are parsed; this allows both the label and line offset in the label and the file name and absolute file line position to be reported in exception information"us"
for microseconds (see Date Formatting Codes)"STARTTLS"
command when connecting to an ESMTP server; this way the class will automatically upgrade the connection to a secure TLS/SSL connection if the server supports it"esmtptls://user@password:smtp.example.com"
)"smtps"
scheme with a default port of 465%s
format argument)"Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))"
)if
expression is now evaluated as True: Previously (i.e. with %strict-bool-eval) the if
expression above would be evaluated as False because the string value was converted to an integer 0, however as of Qore 0.8.6 (with the default perl-bool-eval) it is True since the string is not empty; empty strings and string value "0"
are evaluated as False."00"
). In this case, the old logic would always return False, because the value was first converted to an integer 0
, whereas the new logic will return True. Note that in the case of a string with a single "0"
, both the old and new boolean logic returns False."0"
and empty strings, integer, float, and number 0
(zero), absolute date 1970-01-01Z
(ie the start of the epoch with an offset of 0), relative date 0s
(or any relative date with a 0 duration), NULL, empty binary objects, empty hashes, and empty lists. All other values are True. NUMERIC
(ie DECIMAL
or NUMBER
) column values when retrieved from databases by Qore DBI drivers that support the new capability DBI_CAP_HAS_NUMBER_SUPPORT (previously these values would be retrieved as Qore strings in order to avoid information loss).MyConcreteClass
is not abstract, whereas previously because the return types in the child class were not exact, MyConcreteClass
would be considered abstract by qore): "timezone"
option."key"
and "value"
, allowing for more convenient iteration with constructions that only use getValue()
methods (such as the foreach statement); to accommodate this, two new methods were added to the HashIterator base class:
"\n"
, "\r"
, or "\r\n"
; the last one only if the underlying file is not a TTY in order to avoid stalling I/O on an interactive TTY)"A"
and "a"
, (hexadecimal floating-point output) "G"
, "g"
, (compact floating-point output) "F"
, (non-scientific floating-point output) and "E"
and "e"
(scientific/exponential floating-point output) format arguments for floats and numbers (new arbitrary-precision number type values); see String Formatting"number"
instead of "string"
(see also sql_binding)"_"
characters in q-encoded headers were not encoded correctlyQOREADDRINFO-GETINFO-ERROR
exception description by adding information about the arguments passed"host"
output key for indicating that the ipv6 protocol be used"MON"
and "DAY"
, etc"type"
and "typename"
keys to the EVENT_HOSTNAME_RESOLVED event"type"
, "typename"
, and "address"
keys to the EVENT_CONNECTING event"arg"
key"class ::X::ClassName ..."
)"int i();"
)SOCKET-CLOSED
error when reading a HTTP header if no data is received"null"
for NOTHING with %y"\r"
as whitespace to allow better parsing of sources with Windows EOL markersstr =~ s/public (name)/$2/g