Database Basics (databasics?)


#1

I’ve been programming in NSBasic for many years, but have been away for a long while. I used to use Mike Verive’s database creation software, which I don’t think would work in the new IDE (and I’ve forgotten how to use it, anyway). This leaves me with a bunch of very newbie questions, I’m hoping someone takes pity on me.

I’d be starting with very simple databases consisting only of strings. The first column would be the key (examples: “Atrial Fibrillation”, “Ventricular Tachycardia”). The next few columns would be text strings meant for display in the front end. The final column would be a text string with various labels in it (examples to match the keys above: “Narrow Tachy Irregular”, “Wide Tachy Regular”).

Here are my questions:

What tools are typically used to create a database like this, so that NSBasic can work with it?

I currently have tab-delimited text files in this format with hundreds of entries, is there a streamlined way to convert them into the proper format?

How is the database compiled into, or packaged with, the final app?

What would the code look like (BASIC, not Javascript) to extract data? The most common operation I would do would be to read through each entry, see if the final column contained one or more specific labels, and if it did, save the contents of that entire row in a variable. For example, if search terms included “Irregular” and “Tachy”, I’d get the contents of the “Atrial Fibrillation” entry as VarA=column1.text, VarB=column2.text, VarC=column3.text, and so on - I hope this pseudocode makes sense. If the search was just “Tachy”, I’d get the same for both the Atrial Fibrillation and the Ventricular Tachycardia entries. There are about 100 entries in this particular example.

I hope I’m not appearing too much like an idiot, although I admit that am essentially a complete idiot when it comes to this area.

Thank you,

~Steven


#2

SQLite seems to be the database of choice of NSBasic

https://wiki.nsbasic.com/Using_SQLite

I’ve done a few things with it over the years, but not with NSBasic. For easy creation and editing of your database, I’d recommend something like SQLite Browser:

https://sqlitebrowser.org/

SQLite will run as is (someone correct me if I’m wrong) from any language that supports it - it’s simply a file(s) that reside in your project.


#3

Thank you John!!

Are there any SQLite experts out there who are interested in spending a very small amount of time getting me up & running? This is a vanity (ie non-commercial, no income) project for me, so it would be token payment…

Thanks again,

~Steven


#4

I unfortunately don’t have time at this very second, looks like there are some good examples in the sample files SQLSample1, SQLSample2 and SQLSample3 that should get you up and running pretty quick.