From aaa59b1ef01ec67c0bdc5ff05b190eeecbcabd3e Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Thu, 24 Oct 2024 16:17:12 +0100 Subject: [PATCH 01/29] further notes for odbc (custom auth, windows tracing) --- docs/interfaces/q-server-for-odbc3.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/interfaces/q-server-for-odbc3.md b/docs/interfaces/q-server-for-odbc3.md index 83128100..7a5483ae 100644 --- a/docs/interfaces/q-server-for-odbc3.md +++ b/docs/interfaces/q-server-for-odbc3.md @@ -154,6 +154,11 @@ Also, SQL selects from partitioned tables are not supported – one should pre-s `test.q` provides additional examples of SQL usage, including the create/insert/update/delete statement syntax. +## Custom authentication + +Custom authentication is supported whereby the username and password as set in a DSN or connection string are transformed by a user supplied function. +See `customauth.txt` in the [qodbc3.zip](https://github.com/KxSystems/kdb/blob/master/c/qodbc3.zip) for details. + ## Debugging ODBC implementations provide a tracing capability to log interactions with an ODBC driver. This can aid in diagnosing any issues. Tracing can have a detremental @@ -184,6 +189,21 @@ powershell da8-9a0 EXIT SQLGetData with return code 0 (SQL_SUCCESS) SQLLEN * 0x000000DAA198E160 (2) ``` +Note that Windows ODBC tracing can present a misleading invalid length error for connections that are null-terminated. +The `-3` (SQL_NTS) length value is used by ODBC to indicate a null-terminated string. + +```txt +powershell 127c-12c4 EXIT SQLDriverConnectW with return code 0 (SQL_SUCCESS) + HDBC 0x0000028E2F1EDAD0 + HWND 0x0000000000000000 + WCHAR * 0x00007FF9A40772C0 [ -3] "******\ 0" + SWORD -3 + WCHAR * 0x00007FF9A40772C0 [-3] + SWORD -3 + SWORD * 0x0000000000000000 + UWORD 0 +``` + Please ensure tracing is disabled after debugging complete. ### Linux From ba58b4177223dd6c44f7dc6783bcb5ab5dfa8788 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Fri, 25 Oct 2024 16:54:25 +0100 Subject: [PATCH 02/29] update odbc client details (inc eval timeout) --- docs/interfaces/q-client-for-odbc.md | 41 +++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/docs/interfaces/q-client-for-odbc.md b/docs/interfaces/q-client-for-odbc.md index be37a568..1f0a40c0 100644 --- a/docs/interfaces/q-client-for-odbc.md +++ b/docs/interfaces/q-client-for-odbc.md @@ -5,12 +5,8 @@ keywords: api, interface, kdb+, library, odbc, q --- # :fontawesome-solid-database: Q client for ODBC - - - In Windows and Linux, you can use ODBC to connect to a non-kdb+ database from q. - ## Installation To install, download @@ -47,7 +43,7 @@ This returns a connection handle, which is used for subsequent ODBC calls: ```q q)\l odbc.k -q)h:.odbc.open `northwind / open northwind database +q)h:.odbc.open "dsn=northwind" / use DSN to connect northwind database q).odbc.tables h / list tables `Categories`Customers`Employees`Order Details`Orders`Products.. q).odbc.eval[h;"select * from Orders"] / run a select statement @@ -61,7 +57,7 @@ OrderID CustomerID EmployeeID OrderDate RequiredDate.. Alternatively, use `.odbc.load` to load the entire database into q: ```q q)\l odbc.k -q).odbc.load `northwind / load northwind database +q).odbc.load "dsn=northwind" / load northwind database q)Orders OrderID| CustomerID EmployeeID OrderDate RequiredDate .. -------| ----------------------------------------------.. @@ -88,14 +84,26 @@ Functions defined in the `.odbc` context: Closes an ODBC connection handle: ```q -q).odbc.close h +.odbc.close x ``` +Where x is the connection value returned from [`.odbc.open`](#open). ### `eval` Evaluate a SQL expression: +```q +.odbc.eval[x;y] +``` + +Where + +* x is either + * the connection value returned from [`.odbc.open`](#open). + * a 2 item list containing the connection value returned from [`.odbc.open`](#open), and a timeout (long). +* y is the statement to execute on the data source. + ```q q)sel:"select CompanyName,Phone from Customers where City='London'" q)b:.odbc.eval[h;sel] @@ -113,6 +121,7 @@ CompanyName Phone ------------------------------------- "B's Beverages" "(171) 555-1212" "Seven Seas Imports" "(171) 555-1717" +q)b:.odbc.eval[(h;5);sel) / same query with 5 second timeout ``` @@ -120,6 +129,12 @@ CompanyName Phone Loads an entire database into the session: +```q +.odbc.load x +``` + +Where x is the same parameter defintion as that passed to [`.odbc.open`](#open). + ```q q).odbc.load `northwind q)\a @@ -148,6 +163,12 @@ q)h List tables in database: +```q +.odbc.tables x +``` + +Where x is the connection value returned from [`.odbc.open`](#open). + ```q q).odbc.tables h `Categories`Customers`Employees`Order Details`Orders`Products... @@ -158,6 +179,12 @@ q).odbc.tables h List views in database: +```q +.odbc.views x +``` + +Where x is the connection value returned from [`.odbc.open`](#open). + ```q q).odbc.views h `Alphabetical List of Products`Category Sales for 1997`Current... From 6a320b9d40de54d277b8f5010aa48e74f0c47884 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Fri, 25 Oct 2024 19:12:47 +0100 Subject: [PATCH 03/29] updated odbc client information --- docs/interfaces/q-client-for-odbc.md | 39 ++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/docs/interfaces/q-client-for-odbc.md b/docs/interfaces/q-client-for-odbc.md index 1f0a40c0..cafad8fe 100644 --- a/docs/interfaces/q-client-for-odbc.md +++ b/docs/interfaces/q-client-for-odbc.md @@ -136,7 +136,7 @@ Loads an entire database into the session: Where x is the same parameter defintion as that passed to [`.odbc.open`](#open). ```q -q).odbc.load `northwind +q).odbc.load "dsn=northwind" q)\a `Categories`Customers`Employees`OrderDetails`Orders`Products`Shippers`Supplie.. q)Shippers @@ -150,14 +150,43 @@ ShipperID| CompanyName Phone ### `open` -Open a connection to a database, returning an ODBC connection handle. For example: +Open a connection to a database. ```q -q)h:.odbc.open `northwind -q)h -77932560 +.odbc.open x ``` +Where x is a + +* string representing an ODBC connection string. Can include DSN and various driver/vendor defined values. For example: + ```q + q)h:.odbc.open "dsn=kdb" + q)h:.odbc.open "driver=Microsoft Access Driver (*.mdb, *.accdb);dbq=C:\\CDCollection.mdb" + q)h:.odbc.open "dsn=kdb;uid=my_username;pwd=my_password" + ``` +* mixed list of connection string and timeout (long), for example: + ```q + q)h:.odbc.open ("dsn=kdb;";60) + ``` +* symbol representing a DSN. The symbol value may end with the following supported values for shortcut operations: + * `.dsn` is a shortcut for file DSN, for example: + ```q + h:.odbc.open `test.dsn / uses C:\Program Files\Common Files\odbc/data source\test.dsn on windows + / and /etc/ODBCDataSources/test.dsn on linux + ``` + * `.mdb` is a shortcut for the Microsoft Access driver. For example: + ```q + q)h:.odbc.open `$"C:\\CDCollection.mdb" / resolves to "driver=Microsoft Access Driver (*.mdb);dbq=C:\\CDCollection" + ``` + Note that the driver name above must match the driver installed. If the driver name differs, an alternative is to the use a string value rather than this shortcut. + * `.mdf` is a shortcut for the SQL Server driver. For example: + ```q + q)h:.odbc.open `my_db.mdf / resolves to "driver=sql server;server=(local);trusted_connection=yes;database=my_db" + ``` + Note that the driver name above must match the driver installed. If the driver name differs, an alternative is to the use a string value rather than this shortcut. +* list of three symbols. First symbol represents the DSN, second for username, third for password. + +Returns an ODBC connection handle. ### `tables` From 14a7f6716ddd2de7cf6ea9af7d30ca3bcae049d0 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Fri, 25 Oct 2024 19:15:36 +0100 Subject: [PATCH 04/29] fix link to wrong odbc util --- docs/database/mdb-odbc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/database/mdb-odbc.md b/docs/database/mdb-odbc.md index 4de022bd..32ffeea2 100644 --- a/docs/database/mdb-odbc.md +++ b/docs/database/mdb-odbc.md @@ -32,4 +32,4 @@ q).odbc.eval[h;"select * from aa"] --- :fontawesome-solid-handshake: -[Q driver for ODBC3](../interfaces/q-server-for-odbc3.md) \ No newline at end of file +[Q client for ODBC](../interfaces/q-client-for-odbc.md) From 76314aa694a05845952c216fe7ec2e40a643c1ac Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Mon, 28 Oct 2024 11:03:30 +0000 Subject: [PATCH 05/29] corrected mdb page for odbc --- docs/database/mdb-odbc.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/database/mdb-odbc.md b/docs/database/mdb-odbc.md index 32ffeea2..27148412 100644 --- a/docs/database/mdb-odbc.md +++ b/docs/database/mdb-odbc.md @@ -6,30 +6,29 @@ date: November 2020 # :fontawesome-brands-windows: Access a table from an MDB file via ODBC +Install the [ODBC client driver for kdb+](../interfaces/q-client-for-odbc.md). +Install Microsoft ODBC driver for Microsoft Access. -From Windows, load `odbc.k` into your q session, and then load the MDB file. +Using the driver installed, a MDB file can be opened using the following example command: -```powershell -C:>q w32\odbc.k -``` ```q -q)h: .odbc.load `mydb.mdb +q)h:.odbc.open "driver=Microsoft Access Driver (*.mdb, *.accdb);dbq=C:\\mydb.mdb" ``` -This loads the entire database, which may consist of several tables. Use `.odbc.tables` to list the tables. +!!! note "The name of the driver may differ between versions. The above command should be altered to reflect the driver name installed." + +Use [`.odbc.tables`](../interfaces/q-client-for-odbc.md#tables) to list the tables. ```q q).odbc.tables h `aa`bb`cc`dd`ii`nn ``` -Use `.odbc.eval` to evaluate SQL commands via ODBC. +Use [`.odbc.eval`](../interfaces/q-client-for-odbc.md#eval) to evaluate SQL commands via ODBC. ```q q).odbc.eval[h;"select * from aa"] ``` ---- -:fontawesome-solid-handshake: -[Q client for ODBC](../interfaces/q-client-for-odbc.md) +An alternative to querying via SQL is to load the entire database into kdb+ via the [.odbc.load](../interfaces/q-client-for-odbc.md#load) command, where the data can then be queried using kdb+ directly.. From 582e4c05e2e2a8842b0e4e7329f81b7251c4f21f Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Mon, 28 Oct 2024 17:55:58 +0000 Subject: [PATCH 06/29] add some clarity to sd1 --- docs/interfaces/capiref.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/interfaces/capiref.md b/docs/interfaces/capiref.md index 1ff10f13..8f1e7aaa 100644 --- a/docs/interfaces/capiref.md +++ b/docs/interfaces/capiref.md @@ -911,12 +911,12 @@ Put the function `K f(I d){…}` on the q main event loop given a socket `d`. If `d` is negative, the socket is switched to non-blocking. -The function `f` should return `NULL` or a pointer to a K object, and its reference count will be decremented. -(It is the return value of `f` that will be `r0`’d – and only if not null.) +The function `f` should return `NULL` or a pointer to a K object. +If the return value of `f` is a pointer to a K object, its reference count will be decremended i.e. passed to [`r0`](#r0-decrement-refcount). Shared library only. -On success, returns int K object containing `d`. On error, `NULL` is returned, `d` is closed. +On success, `sd1` returns an K object of type integer, containing `d`. On error, `NULL` is returned and `d` is closed. Since 4.1t 2023.09.15, sd1 no longer imposes a limit of 1023 on the value of the descriptor submitted. From 36c35b962a647de2d5552714ab039f47f00f5e58 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Tue, 29 Oct 2024 09:59:24 +0000 Subject: [PATCH 07/29] incorrect output for tok example fixed --- docs/ref/tok.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/ref/tok.md b/docs/ref/tok.md index 26369015..6b276721 100644 --- a/docs/ref/tok.md +++ b/docs/ref/tok.md @@ -26,7 +26,6 @@ returns `y` as an atom value interpreted according to `x`. q){([result:key'[x$\:()]];short:neg x;char:upper .Q.t x)}5h$where" "<>20#.Q.t result | short char ---------| ---------- -string | 0 * boolean | -1 B guid | -2 G byte | -4 X From 5a6869a80271e010cbeefa88a64ae777bdccb469 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Wed, 30 Oct 2024 15:12:33 +0000 Subject: [PATCH 08/29] additional notes for sd0/sd1 --- docs/interfaces/capiref.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/interfaces/capiref.md b/docs/interfaces/capiref.md index 8f1e7aaa..db24c2e9 100644 --- a/docs/interfaces/capiref.md +++ b/docs/interfaces/capiref.md @@ -885,7 +885,7 @@ Increment an object‘s reference count. V sd0(I d) ``` -Remove the callback on `d` and call `kclose`. +Remove the callback on `d` and call `kclose`. Should only be called from main thread. Shared library only. @@ -896,9 +896,9 @@ Shared library only. V sd0x(I d, I f) ``` -Remove the callback on `d` and call `kclose` on `d` if `f` is 1. +Remove the callback on `d` and call `kclose` on `d` if `f` is 1. Should only be called from main thread. -Shared library only. Since V3.0 2013.04.04. +Shared library only. Ssince V3.0 2013.04.04. ### `sd1` (set function on loop) @@ -907,19 +907,19 @@ Shared library only. Since V3.0 2013.04.04. K sd1(I d, f) ``` -Put the function `K f(I d){…}` on the q main event loop given a socket `d`. +Put the function `K f(I d){…}` on the q main event loop given a socket `d`. Should only be called from main thread. If `d` is negative, the socket is switched to non-blocking. The function `f` should return `NULL` or a pointer to a K object. If the return value of `f` is a pointer to a K object, its reference count will be decremended i.e. passed to [`r0`](#r0-decrement-refcount). -Shared library only. - On success, `sd1` returns an K object of type integer, containing `d`. On error, `NULL` is returned and `d` is closed. Since 4.1t 2023.09.15, sd1 no longer imposes a limit of 1023 on the value of the descriptor submitted. +Shared library only. + :fontawesome-regular-hand-point-right: [Callbacks](c-client-for-q.md#callbacks) From af5739fda6ccb23a6b617d7b601613800e833fe8 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Fri, 1 Nov 2024 13:53:10 +0000 Subject: [PATCH 09/29] updated time conversions in comparisons --- docs/basics/comparison.md | 21 +++++++++++++++++++++ docs/kb/temporal-data.md | 7 +------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/basics/comparison.md b/docs/basics/comparison.md index b8a28995..0e647724 100644 --- a/docs/basics/comparison.md +++ b/docs/basics/comparison.md @@ -73,6 +73,27 @@ q)(1 + 1e-13) = 1 ## Temporal values +Matrix of the [type](datatypes.md) used when the temporal types differ in a comparison (note: scrolling to the right may be required to view full table): + +| comparison types | **timestamp** | **month** | **date** | **datetime** | **timespan** | **minute** | **second** | **time** | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | +| **timestamp** | _timestamp_ | _timestamp_ | _timestamp_ | _timestamp_ | _timespan_ | _minute_ | _second_ | _time_ | +| **month** | _timestamp_ | _month_ | _date_ | _not supported_ | _not supported_ | _not supported_ |_not supported_ | _not supported_ | +| **date** | _timestamp_ | _date_ | _date_ | _datetime_ | _not supported_ | _not supported_ |_not supported_ | _not supported_ | +| **datetime** | _timestamp_ | _not supported_ | _datetime_ | _datetime_ | _timespan_ | _minute_ | _second_ | _time_ | +| **timespan** | _timespan_ | _not supported_ | _not supported_ | _timespan_ | _timespan_ | _timespan_ | _timespan_ | _timespan_ | +| **minute** | _minute_ | _not supported_ | _not supported_ | _minute_ | _timespan_ | _minute_ | _second_ | _time_ | +| **second** | _second_ | _not supported_ | _not supported_ | _second_ | _timespan_ | _second_ | _second_ | _time_ | +| **time** | _time_ | _not supported_ | _not supported_ | _time_ | _timespan_ | _time_ | _time_ | _time_ | + +For example +```q +q)20:00:00.000603286 within 13:30 20:00t / comparison of timespan and time, time converted to timespan values 0D13:30:00.000000000 0D20:00:00.000000000 +0b +q)2024.10.07D20:00:00.000603286 within 13:30 20:00t / comparison of timestamp and time, timestamp converted to time value 20:00:00.000 +1b +``` + Particularly notice the comparison of ordinal with cardinal datatypes, such as timestamps with minutes. ```q diff --git a/docs/kb/temporal-data.md b/docs/kb/temporal-data.md index c43a7fc8..0f8ce965 100644 --- a/docs/kb/temporal-data.md +++ b/docs/kb/temporal-data.md @@ -5,11 +5,6 @@ keywords: data, kdb+, q, temporal --- # How to handle temporal data in q - - - - - ## Stepped attribute In traditional RDMSs temporal changes in data are often represented by adding valid-time-interval information to each relationship, usually achieved by adding start and end columns to the relational tables. This approach is often wasteful because in many cases the end of each interval is the start of the next leading to a lot of repetition. Q offers a better alternative. Recall that adding an `` `s `` attribute to a dictionary makes it behave as a step function. @@ -101,7 +96,7 @@ To update such a dict, remove the `` `s`` attribute, upsert, and add the `` `s`` ## Comparing temporals -Particularly notice the comparison of ordinal with cardinal datatypes, such as timestamps with minutes. +Particularly notice the [comparison of ordinal with cardinal datatypes](../basics/comparison.md#temporal-values), such as timestamps with minutes. ```q q)times: 09:15:37 09:29:01 09:29:15 09:29:15 09:30:01 09:35:27 From 163784327f7c7794af4a1b18ee4cf1b54ef56d37 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Fri, 1 Nov 2024 16:37:03 +0000 Subject: [PATCH 10/29] removed dup time comparison info --- docs/basics/comparison.md | 69 ++++++++++++++++++++++++++++++--------- docs/kb/temporal-data.md | 58 +------------------------------- 2 files changed, 55 insertions(+), 72 deletions(-) diff --git a/docs/basics/comparison.md b/docs/basics/comparison.md index 0e647724..2c07d4c1 100644 --- a/docs/basics/comparison.md +++ b/docs/basics/comparison.md @@ -73,7 +73,7 @@ q)(1 + 1e-13) = 1 ## Temporal values -Matrix of the [type](datatypes.md) used when the temporal types differ in a comparison (note: scrolling to the right may be required to view full table): +Below is a matrix of the [type](datatypes.md) used when the temporal types differ in a comparison (note: scrolling to the right may be required to view full table): | comparison types | **timestamp** | **month** | **date** | **datetime** | **timespan** | **minute** | **second** | **time** | | --- | --- | --- | --- | --- | --- | --- | --- | --- | @@ -98,27 +98,66 @@ Particularly notice the comparison of ordinal with cardinal datatypes, such as t ```q q)times: 09:15:37 09:29:01 09:29:15 09:29:15 09:30:01 09:35:27 -q)spans:`timespan$times / timespans: cardinal -q)stamps:.z.D+times / timestamps: ordinal -q)t:09:29 / minute: cardinal +q)tab:([] timeSpan:`timespan$times; timeStamp:.z.D+times) +q)meta tab +c | t f a +---------| ----- +timeSpan | n +timeStamp| p ``` -When comparing ordinals with cardinals, ordinal is converted to the cardinal type first: `stamps=t` is equivalent to ``(`minute$stamps)=t`` and thus +When comparing `timestamp` with `minute`, the timestamps are converted to minutes such that `` `minute$2024.11.01D09:29:15.000000000 `` becomes `09:29` and therefore doesnt appear in the output: ```q -q)(stampst) -100000b +q)select from tab where timeStamp>09:29 / comparing timestamp with minute +timeSpan timeStamp +-------------------------------------------------- +0D09:30:01.000000000 2016.09.06D09:30:01.000000000 +0D09:35:27.000000000 2016.09.06D09:35:27.000000000 +``` + +When comparing `timespan` with `minute`, the minute is converted to timespan such that `09:29` becomes `0D09:29:00.000000000` for the following comparison: + +```q +q)select from tab where timeSpan>09:29 / comparing timespan with minute +timeSpan timeStamp +-------------------------------------------------- +0D09:29:01.000000000 2016.09.06D09:29:01.000000000 +0D09:29:15.000000000 2016.09.06D09:29:15.000000000 +0D09:29:15.000000000 2016.09.06D09:29:15.000000000 +0D09:30:01.000000000 2016.09.06D09:30:01.000000000 +0D09:35:27.000000000 2016.09.06D09:35:27.000000000 +``` + +Therefore, when comparing ordinals with cardinals (i.e. timestamp with minute), ordinal is converted to the cardinal type first. + +For example: +```q +q)select from tab where timeStamp=09:29 +timeSpan timeStamp +-------------------------------------------------- +0D09:29:01.000000000 2016.09.06D09:29:01.000000000 +0D09:29:15.000000000 2016.09.06D09:29:15.000000000 +0D09:29:15.000000000 2016.09.06D09:29:15.000000000 + +q)tab.timeStamp=09:29 011100b -000011b -q)(spanst) +``` + +is equivalent to + +```q +q)(`minute$tab.timeStamp)=09:29 +011100b +``` +and thus +```q +q)tab.timeStamp<09:29 100000b -000000b -011111b +q)tab.timeStamp>09:29 +000011b ``` -:fontawesome-solid-graduation-cap: -[Comparing temporals](../kb/temporal-data.md#comparing-temporals) -
:fontawesome-solid-street-view: _Q for Mortals_ [§4.9.1 Temporal Comparison](/q4m3/4_Operators/#491-temporal-comparison) @@ -126,7 +165,7 @@ _Q for Mortals_ ## Different types -The comparison operators also work on text values (characters, symbols) – not always intuitively. +The comparison operators also work on text values (characters, symbols). ```q q)"0" < ("4"; "f"; "F"; 4) / characters are treated as their numeric value diff --git a/docs/kb/temporal-data.md b/docs/kb/temporal-data.md index 0f8ce965..d7b86345 100644 --- a/docs/kb/temporal-data.md +++ b/docs/kb/temporal-data.md @@ -96,63 +96,7 @@ To update such a dict, remove the `` `s`` attribute, upsert, and add the `` `s`` ## Comparing temporals -Particularly notice the [comparison of ordinal with cardinal datatypes](../basics/comparison.md#temporal-values), such as timestamps with minutes. - -```q -q)times: 09:15:37 09:29:01 09:29:15 09:29:15 09:30:01 09:35:27 - -q)tab:([] timeSpan:`timespan$times; timeStamp:.z.D+times) -q)meta tab -c | t f a ----------| ----- -timeSpan | n -timeStamp| p - -q)select from tab where timeStamp>09:29 -timeSpan timeStamp --------------------------------------------------- -0D09:30:01.000000000 2016.09.06D09:30:01.000000000 -0D09:35:27.000000000 2016.09.06D09:35:27.000000000 - -q)select from tab where timeSpan>09:29 -timeSpan timeStamp --------------------------------------------------- -0D09:29:01.000000000 2016.09.06D09:29:01.000000000 -0D09:29:15.000000000 2016.09.06D09:29:15.000000000 -0D09:29:15.000000000 2016.09.06D09:29:15.000000000 -0D09:30:01.000000000 2016.09.06D09:30:01.000000000 -0D09:35:27.000000000 2016.09.06D09:35:27.000000000 -``` - -It looks like the timestamp filter is searching for any _minute_ greater than `09:29`, while the timespan is returning any _times_ that are greater than `09:29`. - -When comparing ordinals with cardinals (i.e. timestamp with minute), ordinal is converted to the cardinal type first. E.g. in - -```q -q)select from tab where timeStamp=09:29 -timeSpan timeStamp --------------------------------------------------- -0D09:29:01.000000000 2016.09.06D09:29:01.000000000 -0D09:29:15.000000000 2016.09.06D09:29:15.000000000 -0D09:29:15.000000000 2016.09.06D09:29:15.000000000 - -q)tab.timeStamp=09:29 -011100b -``` - -is equivalent to - -```q -q)(`minute$tab.timeStamp)=09:29 -011100b -``` -and thus -```q -q)tab.timeStamp<09:29 -100000b -q)tab.timeStamp>09:29 -000011b -``` +Note the [comparison of ordinal with cardinal datatypes](../basics/comparison.md#temporal-values), particularly when the types differ. :fontawesome-solid-book-open: [Comparison](../basics/comparison.md) From d7ef6c33f7d399cdd98e19762e847100122ec388 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Fri, 1 Nov 2024 16:43:25 +0000 Subject: [PATCH 11/29] made it easier to find floating point in comparison page --- docs/basics/comparison.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/basics/comparison.md b/docs/basics/comparison.md index 2c07d4c1..c1fa7839 100644 --- a/docs/basics/comparison.md +++ b/docs/basics/comparison.md @@ -162,6 +162,9 @@ q)tab.timeStamp>09:29 _Q for Mortals_ [§4.9.1 Temporal Comparison](/q4m3/4_Operators/#491-temporal-comparison) +## Floating point + +Comparison of floating-point types are discussed in [`comparison tolerance`](precision.md#comparison-tolerance). ## Different types @@ -201,7 +204,6 @@ q)n < neg inf 11111b ``` - ## Infinities Infinities of different type are ordered by their width. @@ -238,9 +240,6 @@ Keyword [`differ`](../ref/differ.md) is a uniform unary function that returns a [Match](../ref/match.md) (`~`) compares its arguments and returns a boolean atom to say whether they are the same. -:fontawesome-solid-book: -[Comparison tolerance](precision.md#comparison-tolerance) -
:fontawesome-solid-street-view: _Q for Mortals_ [§4.3.3 Order](/q4m3/4_Operators/#433-order) From 13510419c1422adfc7039d5bb728aac740a9369c Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Sat, 2 Nov 2024 21:19:41 +0000 Subject: [PATCH 12/29] add links to precision --- docs/basics/precision.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/basics/precision.md b/docs/basics/precision.md index fc1d904e..ac1ef467 100644 --- a/docs/basics/precision.md +++ b/docs/basics/precision.md @@ -10,7 +10,7 @@ keywords: comparison, float, precision, tolerance ## Float precision -Precision of floats is a tricky issue since floats (_doubles_ in other languages) are actually binary rational approximations to real numbers. Whenever you are concerned with precision, set `\P 0` before doing anything else, so that you can see what’s really going on. +Precision of floats is a tricky issue since floats (_doubles_ in other languages) are actually binary rational approximations to real numbers. Whenever you are concerned with precision, set [`\P 0`](syscmds.md#p-precision) before doing anything else, so that you can see what’s really going on. Due to the finite accuracy of the binary representation of floating-point numbers, the last decimal digit of a float is not reliable. This is not peculiar to kdb+. @@ -22,7 +22,7 @@ q)1%3 Efficient algorithms for complex calculations such as log and sine introduce imprecision. Moreover, even basic calculations raise issues of rounding. The IEEE floating-point spec addresses many such issues, but the topic is complex. -Q takes this into account in its implementation of the equality operator `=`, which should actually be read as “tolerantly equal.” Roughly speaking, this means that the difference is relatively small compared to some acceptable representation error. This makes the following hold: +Q takes this into account in its implementation of the equality operator [`=`](comparison.md), which should actually be read as “tolerantly equal.” Roughly speaking, this means that the difference is relatively small compared to some acceptable representation error. This makes the following hold: ```q q)r7:1%7 @@ -102,7 +102,7 @@ The l64 builds of kdb+ now have a faster SIMD [`sum`](../ref/sum.md) implementat Consider the task of calculating the sum of `1e-10*til 10000000`. -The SIMD code is equivalent to the following (`\P 0`): +The SIMD code is equivalent to the following ([`\P 0`](syscmds.md#p-precision)): ```q q){x+y}over{x+y}over 0N 8#1e-10*til 10000000 @@ -280,4 +280,4 @@ These do not use comparison tolerance, and are therefore appropriate for databas :fontawesome-regular-hand-point-right: [Comparison](comparison.md), -[Match](../ref/match.md), [`differ`](../ref/differ.md) \ No newline at end of file +[Match](../ref/match.md), [`differ`](../ref/differ.md) From d7cb982868c705835e6bff7c22cc3fe4b0fb8d70 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Mon, 4 Nov 2024 20:24:09 +0000 Subject: [PATCH 13/29] add conversions links to .z.a, .z.h --- docs/ref/dotz.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ref/dotz.md b/docs/ref/dotz.md index b4120a7b..3e059699 100644 --- a/docs/ref/dotz.md +++ b/docs/ref/dotz.md @@ -87,7 +87,7 @@ q)"i"$0x0 vs .z.a When invoked via a Unix Domain Socket, it is 0. :fontawesome-solid-hand-point-right: -[`.z.h`](#zh-host) (host) +[`.z.h`](#zh-host) (host), [`.Q.host`](dotq.md#host-ip-to-hostname) (IP to hostname) ## `.z.ac` (HTTP auth) @@ -355,7 +355,7 @@ q).Q.host .z.a ``` :fontawesome-solid-hand-point-right: -[`.z.a`](#za-ip-address) (IP address) +[`.z.a`](#za-ip-address) (IP address), [`.Q.addr`](dotq.md#addr-iphost-as-int) (IP/host as int) ## `.z.i` (PID) From ef7cd8903fe526523963d73d5375267cfdbf92b6 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Tue, 5 Nov 2024 17:47:49 +0000 Subject: [PATCH 14/29] fix broken links due to old name change --- docs/basics/cmdline.md | 2 +- docs/basics/syscmds.md | 2 +- docs/ref/index.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/basics/cmdline.md b/docs/basics/cmdline.md index eb51153c..9a010ddf 100644 --- a/docs/basics/cmdline.md +++ b/docs/basics/cmdline.md @@ -307,7 +307,7 @@ and with `-q` Replicate from `:host:port`. :fontawesome-solid-book-open: -[`\r` system command](syscmds.md#r-replication-master) +[`\r` system command](syscmds.md#r-replication-primary) ## `-s` (secondary threads) diff --git a/docs/basics/syscmds.md b/docs/basics/syscmds.md index c7a757c9..bf5cf2d7 100644 --- a/docs/basics/syscmds.md +++ b/docs/basics/syscmds.md @@ -25,7 +25,7 @@ keywords: command, kdb+, q, system [\o offset from UTC](#o-offset-from-utc) [\\_ hide q code](#_-hide-q-code) [\p listening port](#p-listening-port) [\\ terminate](#terminate) [\P precision](#p-precision) [\\ toggle q/k](#toggle-qk) -[\r replication master](#r-replication-primary) [\\\\ quit](#quit) +[\r replication primary](#r-replication-primary) [\\\\ quit](#quit) [\r rename](#r-rename) diff --git a/docs/ref/index.md b/docs/ref/index.md index 8f336ca7..2e45874b 100644 --- a/docs/ref/index.md +++ b/docs/ref/index.md @@ -152,7 +152,7 @@ author: Stephen Taylor [`-p`](../basics/cmdline.md#-p-listening-port) [`\p`](../basics/syscmds.md#p-listening-port)listening port[`\_`](../basics/syscmds.md#_-hide-q-code)hide q code [`-P`](../basics/cmdline.md#-p-display-precision) [`\P`](../basics/syscmds.md#p-precision)display precision[`\`](../basics/syscmds.md#terminate)terminate [`-q`](../basics/cmdline.md#-q-quiet-mode)quiet mode[`\`](../basics/syscmds.md#toggle-qk)toggle q/k -[`-r`](../basics/cmdline.md#-r-replicate) [`\r`](../basics/syscmds.md#r-replication-master)replicate[`\\`](../basics/syscmds.md#quit)quit +[`-r`](../basics/cmdline.md#-r-replicate) [`\r`](../basics/syscmds.md#r-replication-primary)replicate[`\\`](../basics/syscmds.md#quit)quit :fontawesome-solid-book: From cf70bfc287271b7ab61fcdf7dae035293514f56b Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Wed, 6 Nov 2024 09:51:11 +0000 Subject: [PATCH 15/29] improvement to .z.a doc --- docs/ref/dotz.md | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/docs/ref/dotz.md b/docs/ref/dotz.md index 3e059699..c1011ca5 100644 --- a/docs/ref/dotz.md +++ b/docs/ref/dotz.md @@ -70,21 +70,42 @@ The IP address as a 32-bit integer ```q q).z.a --1062731737i +-1408172030i +``` + +Note its relationship to [`.z.h`](#zh-host) for the hostname, converted to an int using [`.Q.addr`](dotq.md#host-ip-to-hostname). +```q +q).Q.addr .z.h +-1408172030i ``` It can be split into components as follows: ```q q)"i"$0x0 vs .z.a -127 0 0 1 +172 17 0 2i ``` -!!! warning "Callbacks" +When invoked inside a `.z.p*` callback via a TCP/IP connection, it is the IP address of the client session, not the current session. For example, connecting from a remote machine: - When invoked inside a `.z.p*` callback via a TCP/IP connection, it is the IP address of the client session, not the current session. +```q +q)h:hopen myhost:1234 +q)h"\"i\"$0x0 vs .z.a" +192 168 65 1i +``` +or from same machine: +```q +q)h:hopen 1234 +q)h"\"i\"$0x0 vs .z.a" +127 0 0 1i +``` - When invoked via a Unix Domain Socket, it is 0. +When invoked via a Unix Domain Socket, it is 0. +```q +q)h:hopen `:unix://1234 +q)h".z.a" +0i +``` :fontawesome-solid-hand-point-right: [`.z.h`](#zh-host) (host), [`.Q.host`](dotq.md#host-ip-to-hostname) (IP to hostname) From 2495623c26c4519a4e9162cd724dcf4830073f60 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Wed, 6 Nov 2024 13:39:47 +0000 Subject: [PATCH 16/29] add details prior to visiting link --- docs/ref/cast.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ref/cast.md b/docs/ref/cast.md index 996644dc..d46cca09 100644 --- a/docs/ref/cast.md +++ b/docs/ref/cast.md @@ -41,7 +41,7 @@ Where `x` is: - **`0h` or `"*"`**, and `y` is not a string, returns `y` ([Identity](#identity)) -- an **upper-case letter** or a **negative short int**, see [Tok](tok.md) +- an **upper-case letter** or a **negative short int** interprets the value from a string, see [Tok](tok.md) Casting does not change the underlying bit pattern of the data, only how it is represented. From b356fb4009f56844c9badf1353c0754502b8615a Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Wed, 6 Nov 2024 13:40:45 +0000 Subject: [PATCH 17/29] change wording to match rest of doc --- docs/wp/surveillance-latency/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/wp/surveillance-latency/index.md b/docs/wp/surveillance-latency/index.md index ed5ad0c3..e4727ef6 100644 --- a/docs/wp/surveillance-latency/index.md +++ b/docs/wp/surveillance-latency/index.md @@ -465,7 +465,7 @@ includeEachLoopTest | Boolean to toggle on or off the running of the perfo replayFinishTime | If set, only data up to this timestamp will be replayed. Otherwise, 5 minutes of data will be replayed. intradayFrequency | 0 for realTime, 1, 5 or 10 for the number of minutes to run intraday. This test has 4 alert engines running. `99` to run all execution points (all 16 alert engines). Defaults to 1. -These options can be set when starting the master kdb+ process, for +These options can be set when starting the primary kdb+ process, for example: ```bash From 7409de45f6bd404d45c90e425062211b3afb8579 Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:40:12 +0000 Subject: [PATCH 18/29] Update docs/basics/comparison.md Co-authored-by: Veronica Calescu --- docs/basics/comparison.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics/comparison.md b/docs/basics/comparison.md index c1fa7839..10d1a6c9 100644 --- a/docs/basics/comparison.md +++ b/docs/basics/comparison.md @@ -73,7 +73,7 @@ q)(1 + 1e-13) = 1 ## Temporal values -Below is a matrix of the [type](datatypes.md) used when the temporal types differ in a comparison (note: scrolling to the right may be required to view full table): +Below is a matrix of the [type](datatypes.md) used when the temporal types differ in a comparison (note: you may need to scroll to the right to view the full table): | comparison types | **timestamp** | **month** | **date** | **datetime** | **timespan** | **minute** | **second** | **time** | | --- | --- | --- | --- | --- | --- | --- | --- | --- | From be6d80ad2b4b69bcdd4c548cf3702b35cd74ff9b Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:40:23 +0000 Subject: [PATCH 19/29] Update docs/basics/comparison.md Co-authored-by: Veronica Calescu --- docs/basics/comparison.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics/comparison.md b/docs/basics/comparison.md index 10d1a6c9..e3257cdc 100644 --- a/docs/basics/comparison.md +++ b/docs/basics/comparison.md @@ -106,7 +106,7 @@ timeSpan | n timeStamp| p ``` -When comparing `timestamp` with `minute`, the timestamps are converted to minutes such that `` `minute$2024.11.01D09:29:15.000000000 `` becomes `09:29` and therefore doesnt appear in the output: +When comparing `timestamp` with `minute`, the timestamps are converted to minutes such that `` `minute$2024.11.01D09:29:15.000000000 `` becomes `09:29` and therefore doesn't appear in the output: ```q q)select from tab where timeStamp>09:29 / comparing timestamp with minute From bfdc58518df42b9ffba311b251253f033d12a078 Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:40:34 +0000 Subject: [PATCH 20/29] Update docs/basics/comparison.md Co-authored-by: Veronica Calescu --- docs/basics/comparison.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics/comparison.md b/docs/basics/comparison.md index e3257cdc..b2933d50 100644 --- a/docs/basics/comparison.md +++ b/docs/basics/comparison.md @@ -164,7 +164,7 @@ _Q for Mortals_ ## Floating point -Comparison of floating-point types are discussed in [`comparison tolerance`](precision.md#comparison-tolerance). +The comparison of floating-point types are discussed in [`comparison tolerance`](precision.md#comparison-tolerance). ## Different types From 83bd9ac21bf7020334c02bdc30441312385bc921 Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:41:09 +0000 Subject: [PATCH 21/29] Update docs/basics/precision.md Co-authored-by: Veronica Calescu --- docs/basics/precision.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics/precision.md b/docs/basics/precision.md index ac1ef467..6b4e4bcf 100644 --- a/docs/basics/precision.md +++ b/docs/basics/precision.md @@ -10,7 +10,7 @@ keywords: comparison, float, precision, tolerance ## Float precision -Precision of floats is a tricky issue since floats (_doubles_ in other languages) are actually binary rational approximations to real numbers. Whenever you are concerned with precision, set [`\P 0`](syscmds.md#p-precision) before doing anything else, so that you can see what’s really going on. +Precision of floats is a complex issue because floats (known as _doubles_ in other programming languages) are actually binary rational approximations of real numbers. If you are concerned with precision, make sure to set [`\P 0`](syscmds.md#p-precision) before proceeding with anything else. This helps you understand what's really happening with your data. Due to the finite accuracy of the binary representation of floating-point numbers, the last decimal digit of a float is not reliable. This is not peculiar to kdb+. From eef9a370265ffdb98fbf930bfff38b1a8ed5406d Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:41:19 +0000 Subject: [PATCH 22/29] Update docs/database/mdb-odbc.md Co-authored-by: Veronica Calescu --- docs/database/mdb-odbc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/database/mdb-odbc.md b/docs/database/mdb-odbc.md index 27148412..d16d8d99 100644 --- a/docs/database/mdb-odbc.md +++ b/docs/database/mdb-odbc.md @@ -16,7 +16,7 @@ Using the driver installed, a MDB file can be opened using the following example q)h:.odbc.open "driver=Microsoft Access Driver (*.mdb, *.accdb);dbq=C:\\mydb.mdb" ``` -!!! note "The name of the driver may differ between versions. The above command should be altered to reflect the driver name installed." +!!! note "The name of the driver may differ between versions. The command above should be altered to reflect the driver name installed." Use [`.odbc.tables`](../interfaces/q-client-for-odbc.md#tables) to list the tables. From c77eef45cf59b0f655bc4f1b20255a3c88619d7a Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:41:29 +0000 Subject: [PATCH 23/29] Update docs/interfaces/capiref.md Co-authored-by: Veronica Calescu --- docs/interfaces/capiref.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/interfaces/capiref.md b/docs/interfaces/capiref.md index db24c2e9..41dad0b1 100644 --- a/docs/interfaces/capiref.md +++ b/docs/interfaces/capiref.md @@ -914,7 +914,8 @@ If `d` is negative, the socket is switched to non-blocking. The function `f` should return `NULL` or a pointer to a K object. If the return value of `f` is a pointer to a K object, its reference count will be decremended i.e. passed to [`r0`](#r0-decrement-refcount). -On success, `sd1` returns an K object of type integer, containing `d`. On error, `NULL` is returned and `d` is closed. +On success, `sd1` returns a K object of type integer, containing `d`. On error, `NULL` is returned and `d` is closed. + Since 4.1t 2023.09.15, sd1 no longer imposes a limit of 1023 on the value of the descriptor submitted. From 1b6bc6ee2e932aff3dc1396150aa1bc646faaa7c Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:41:37 +0000 Subject: [PATCH 24/29] Update docs/interfaces/q-client-for-odbc.md Co-authored-by: Veronica Calescu --- docs/interfaces/q-client-for-odbc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interfaces/q-client-for-odbc.md b/docs/interfaces/q-client-for-odbc.md index cafad8fe..1ad934b5 100644 --- a/docs/interfaces/q-client-for-odbc.md +++ b/docs/interfaces/q-client-for-odbc.md @@ -164,7 +164,7 @@ Where x is a q)h:.odbc.open "driver=Microsoft Access Driver (*.mdb, *.accdb);dbq=C:\\CDCollection.mdb" q)h:.odbc.open "dsn=kdb;uid=my_username;pwd=my_password" ``` -* mixed list of connection string and timeout (long), for example: +* mixed list of connection string and timeout (long). For example: ```q q)h:.odbc.open ("dsn=kdb;";60) ``` From e7289ef9ca9ed7449d87e856d5027a2617575f66 Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:41:47 +0000 Subject: [PATCH 25/29] Update docs/interfaces/q-client-for-odbc.md Co-authored-by: Veronica Calescu --- docs/interfaces/q-client-for-odbc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interfaces/q-client-for-odbc.md b/docs/interfaces/q-client-for-odbc.md index 1ad934b5..314443bd 100644 --- a/docs/interfaces/q-client-for-odbc.md +++ b/docs/interfaces/q-client-for-odbc.md @@ -169,7 +169,7 @@ Where x is a q)h:.odbc.open ("dsn=kdb;";60) ``` * symbol representing a DSN. The symbol value may end with the following supported values for shortcut operations: - * `.dsn` is a shortcut for file DSN, for example: + * `.dsn` is a shortcut for file DSN. For example: ```q h:.odbc.open `test.dsn / uses C:\Program Files\Common Files\odbc/data source\test.dsn on windows / and /etc/ODBCDataSources/test.dsn on linux From c4e22346dbc81d59960e9cbb9beab19bc57a641b Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:41:57 +0000 Subject: [PATCH 26/29] Update docs/interfaces/q-client-for-odbc.md Co-authored-by: Veronica Calescu --- docs/interfaces/q-client-for-odbc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interfaces/q-client-for-odbc.md b/docs/interfaces/q-client-for-odbc.md index 314443bd..f6ddf30a 100644 --- a/docs/interfaces/q-client-for-odbc.md +++ b/docs/interfaces/q-client-for-odbc.md @@ -184,7 +184,7 @@ Where x is a q)h:.odbc.open `my_db.mdf / resolves to "driver=sql server;server=(local);trusted_connection=yes;database=my_db" ``` Note that the driver name above must match the driver installed. If the driver name differs, an alternative is to the use a string value rather than this shortcut. -* list of three symbols. First symbol represents the DSN, second for username, third for password. +* list of three symbols. First symbol represents the DSN, the second is the username, and the third symbol is for password. Returns an ODBC connection handle. From 79ec49281b8164a84f6b45bf8bb3dba7c9fc22f2 Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:42:10 +0000 Subject: [PATCH 27/29] Update docs/interfaces/q-server-for-odbc3.md Co-authored-by: Veronica Calescu --- docs/interfaces/q-server-for-odbc3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interfaces/q-server-for-odbc3.md b/docs/interfaces/q-server-for-odbc3.md index 7a5483ae..113cd0cc 100644 --- a/docs/interfaces/q-server-for-odbc3.md +++ b/docs/interfaces/q-server-for-odbc3.md @@ -156,7 +156,7 @@ Also, SQL selects from partitioned tables are not supported – one should pre-s ## Custom authentication -Custom authentication is supported whereby the username and password as set in a DSN or connection string are transformed by a user supplied function. +Custom authentication is supported, allowing the username and password specified in a DSN or connection string to be transformed by a user-defined function. See `customauth.txt` in the [qodbc3.zip](https://github.com/KxSystems/kdb/blob/master/c/qodbc3.zip) for details. ## Debugging From cda10e677ab7134161a269d4308ca6366cfaa952 Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:42:23 +0000 Subject: [PATCH 28/29] Update docs/database/mdb-odbc.md Co-authored-by: Veronica Calescu --- docs/database/mdb-odbc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/database/mdb-odbc.md b/docs/database/mdb-odbc.md index d16d8d99..8656fd6a 100644 --- a/docs/database/mdb-odbc.md +++ b/docs/database/mdb-odbc.md @@ -31,4 +31,4 @@ Use [`.odbc.eval`](../interfaces/q-client-for-odbc.md#eval) to evaluate SQL comm q).odbc.eval[h;"select * from aa"] ``` -An alternative to querying via SQL is to load the entire database into kdb+ via the [.odbc.load](../interfaces/q-client-for-odbc.md#load) command, where the data can then be queried using kdb+ directly.. +An alternative to querying through SQL is to load the entire database into kdb+ via the [.odbc.load](../interfaces/q-client-for-odbc.md#load) command, where the data can then be queried using kdb+ directly. From b8fe6eaaf17c99560e2df6e705b96c0a993f6c56 Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:42:37 +0000 Subject: [PATCH 29/29] Update docs/interfaces/capiref.md Co-authored-by: Veronica Calescu --- docs/interfaces/capiref.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/interfaces/capiref.md b/docs/interfaces/capiref.md index 41dad0b1..749ef564 100644 --- a/docs/interfaces/capiref.md +++ b/docs/interfaces/capiref.md @@ -912,7 +912,8 @@ Put the function `K f(I d){…}` on the q main event loop given a socket `d`. Sh If `d` is negative, the socket is switched to non-blocking. The function `f` should return `NULL` or a pointer to a K object. -If the return value of `f` is a pointer to a K object, its reference count will be decremended i.e. passed to [`r0`](#r0-decrement-refcount). +If the return value of `f` is a pointer to a K object, its reference count is decremented i.e. passed to [`r0`](#r0-decrement-refcount). + On success, `sd1` returns a K object of type integer, containing `d`. On error, `NULL` is returned and `d` is closed.