Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-18 Thread Jean-Luc Hainaut
True, "some" parts of "some" games can be implemented with DB technology, particularly matrix- and graph-based ones. Not only for fast storage and retrieval of game data, but, more interestingly, for implementing complex computation algorithms through SQL queries, that may prove faster than

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-18 Thread R Smith
To add some thoughts to Peter's discussion... In game design speed is definitely of the utmost importance since a visual game is basically a UI that is time-sensitive (unlike nearly any other type of software). It's usual to implement some slow data mechanism, typically an internet service DB

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Shane Dev
> Any practical realtime video game using SQLite is probably > doing so only to save and restore the game board between games. and perhaps calculating the initial "maze" or other non time sensitive data processing > Even a cursory look into production > quality video game development will

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread petern
FYI. 2D/3D game usability is extremely sensitive to response time. A stock in-memory SQLite database with plenty of memory is still too slow for tracking the state of an interactive graphical game especially on portable grade cpus. Any practical realtime video game using SQLite is probably doing

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Shane Dev
In my day job, I am an SAP consultant - for over 20 years. Production quality code? Yes, but only within the companies where I have worked - tax, banking, inventory, procurement, sales, etc. My interest in SQLite is a personal hobby project at the moment. I have a couple of ideas for end user

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Richard Hipp
On 1/17/18, petern wrote: > > Richard, since you're responding to questions, let me ask again about 3.22 > INTROPECTION_PRAGMAS release. No. We are past pencils-down. No new features at this point. -- D. Richard Hipp d...@sqlite.org

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread petern
csv.c isn't a writer. Shane expected to write the file by inserting rows into the vtable. He has no application whatsoever but for the shell. Richard, since you're responding to questions, let me ask again about 3.22 INTROPECTION_PRAGMAS release. Will function_list() be progressing at all

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Richard Hipp
On 1/17/18, petern wrote: > Take a look at the function shell_callback for hints. If the goal is to create a TSV reader/writer, it seems like the CVS reader/writer might be a better starting point, as it is unencumbered by lots of other unrelated features as is the

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread petern
Take a look at the function shell_callback for hints. See the MODE_Csv case. You could start by cribbing the functions MODE_Csv uses for your own row handler and then see what you'll have to figure out yourself. Typically, if you are a serious product developer at a frontier in the market, you

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Peter Da Silva
On 1/17/18, 11:07 AM, "sqlite-users on behalf of Jens Alfke" wrote: > If I were tackling this, I’d look for an open-source CSV parser/generator > library. Once you have that, the part that reads/writes the rows to

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Jens Alfke
> On Jan 17, 2018, at 3:53 AM, Bart Smissaert wrote: > > You don't have to, just need a different wheel. If I were tackling this, I’d look for an open-source CSV parser/generator library. Once you have that, the part that reads/writes the rows to the database is

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Bart Smissaert
> I try very hard not to reinvent the wheel You don't have to, just need a different wheel. I did this recently both for .csv and also for .html and working very nicely and far more flexible than using the code in shell.c. RBS On Wed, Jan 17, 2018 at 10:54 AM, Shane Dev

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Shane Dev
On 17 January 2018 at 08:45, petern wrote: > Shane. Expect to do a lot of hacking on shell.c. It's not intended as a > library but as the main program of a console application. That's a shame. I try very hard not to reinvent the wheel especially when the wheel

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-16 Thread petern
Shane. Expect to do a lot of hacking on shell.c. It's not intended as a library but as the main program of a console application. Another way involves controlling the IO handles of your process and sending strings but that will probably run into portability problems that are even a bigger

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-16 Thread Shane Dev
Apparently the CSV virtual table supports neither changes (INSERT, UPDATE, DELETE), nor reading single column csv files. What I really want is the functionality of .import and .output SQLite shell commands. Maybe a better strategy would be to compile shell.c with my c program and call the

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-16 Thread Richard Hipp
On 1/16/18, Shane Dev wrote: > I tried - > > sqlite> CREATE VIRTUAL TABLE temp.t1 USING csv(filename='test.tsv'); > > where test.tsv is a tab separated table. However > > select count(*) from t1; > > goes into an infinite loop. Do you how to specify a separator other than >

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-16 Thread Shane Dev
which imports CSV files without > necessity of the SQLite shell: > > https://sqlite.org/csv.html > > On Tue, Jan 16, 2018 at 12:47 AM, Shane Dev <devshan...@gmail.com> wrote: > > > Hi, > > > > I am looking for an efficient way to write a c program which perfo

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-16 Thread Peter Da Silva
On 1/16/18, 10:29 AM, "sqlite-users on behalf of petern" wrote: > https://sqlite.org/csv.html BTW typo on that page: “The example above showed a single filename='th3file.csv' argument for the CSV

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-16 Thread petern
which performs the > same function as the SQLite shell command ".import" > > My initial strategy is to include the sqlite library source files and copy > the control block from shell.c that begins after > > if( c=='i' && strncmp(azArg[0], "import", n)==0 ){ >

[sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-16 Thread Shane Dev
Hi, I am looking for an efficient way to write a c program which performs the same function as the SQLite shell command ".import" My initial strategy is to include the sqlite library source files and copy the control block from shell.c that begins after if( c=='i' && strncmp