New database commands

Dick Johnson

Tried the new database commands in TCC 23. This example is given in the TCC Help file:

echo Testing file write and read
echo %@unqopen[rwc,test.db]
echo %@unqkvf[test.db,"aaa",ansi.cmd]
echo %@unqclose[test.db]

When I run this, exactly as written in the Help File, line 3 produces an error message:

The system cannot find the file specified.
ansi.cmd

vefatica

That example shows @UNQREADF being used with 3 parameters.
Code:
``echo %@unqreadf[test.db,"aaa",newansi.cmd]``
The help seems to show it requiring at least 4 parameters.
Code:
``@UNQREADF[[u,]filename, "key", outputname, length]``

Also ... apparently, ansi.cmd MUST exist because it's ENTIRE CONTENTS will be paired with "aaa" in the database. Is that really what's desired/intended? It seems a bit strange to me.

rconn

That example shows @UNQREADF being used with 3 parameters.
Code:
``echo %@unqreadf[test.db,"aaa",newansi.cmd]``
The help seems to show it requiring at least 4 parameters.
Code:
``@UNQREADF[[u,]filename, "key", outputname, length]``

The length is optional; if it's not specified the entire file is read.

rconn

Tried the new database commands in TCC 23. This example is given in the TCC Help file:

echo Testing file write and read
echo %@unqopen[rwc,test.db]
echo %@unqkvf[test.db,"aaa",ansi.cmd]
echo %@unqclose[test.db]

When I run this, exactly as written in the Help File, line 3 produces an error message:

The system cannot find the file specified.
ansi.cmd

ANSI.CMD is a dummy file name for the purpose of the example; it must exist in your working directory.

rconn

Also ... apparently, ansi.cmd MUST exist because it's ENTIRE CONTENTS will be paired with "aaa" in the database. Is that really what's desired/intended? It seems a bit strange to me.

Yes, it must exist, and the entire contents will only be paired with "aaa" if you don't specify a length. Why is that strange?

vefatica

Yes, it must exist, and the entire contents will only be paired with "aaa" if you don't specify a length. Why is that strange?
What seems strange is that a copy of the entire file winds up inside the database. Are there situations in which databases actually work that way? Since the file must exist locally, so it would seem more efficient to pair "aaa" with the (fq) name of the file.

rconn

What seems strange is that a copy of the entire file winds up inside the database. Are there situations in which databases actually work that way?

Yes, that's the whole point of a document store database.

If you only need key / value, stick with that.

vefatica

Yes, that's the whole point of a document store database.

If you only need key / value, stick with that.
Hmmm! There's already ZIP (and friends) for a document store database.

You can do the key/value thing in memory ... right? It seems that those wanting an associative array ought to be happy.

rconn

ZIP (and friends) aren't remotely like a document store database. Check out real ones, like MongoDB, or go to the UnQLite web page.

Thread starter Title Forum Replies Date
Dumping an UNQLITE Database Support 1
Console not redrawn in BTM or with multiple commands Support 4
Documentation COMMANDS in Version 27 help Support 8
ALIAS with multiple commands? Support 9
Long commands retrieved from command history have blank line when wrapped Support 20
Timing commands with \$= in the prompt? Support 16
Fixed v25 regression: Parameter expansion fails in piped commands Support 2
Key Commands missing? Support 3
Regexes in REN/MOVE/… commands seem to not work at all Support 3
Bug launching external commands in 20.11.43 Support 11
Keywords for commands, functions, internal variables Support 3
Disable commands? Support 2
Fixed 20.10 strangeness with external commands Support 9
Problem chaining piped FIND commands in BTM Support 7
Some commands are not displaying their command dialog Support 2
MONITOR commands alter tab title when triggered Support 0
Documentation TC Help v18.x "Commands by Category" is incomplete Support 0
How to? Launch and execute commands in tcmd.exe through MSBuild Script. Support 3
list of TCC commands for external editors Support 4
tab completion with directory commands Support 7
most used commands Support 2
How to? TCC and ftp:// commands Support 7
Override TCC internal commands Support 2
Directory history entries from /S option of various commands Support 2
A simple question related to the "dir" (and "pdir") commands... Support 5
TC 13 / Using TCDIALOG to exit commands Support 4
syntax problems multiple commands (command & command) Support 4
C User error with low level file* commands Support 8
Need help to execute TCC commands on another system Support 6
keyboard shotcuts to send commands to a TCC tab? Support 8
Updated _bat.schclass with v11 new commands/keywords Support 1
Vista 64 bits missing commands Support 1
Commands to launch Control Panel items? Support 10