w r | 16 Jul 19:38
Picon
Favicon

sqlite

I'm experimenting with the sqlite interface (bigloo 3.1a on linux), and ran into 2 issues:

1) This code gets an error parsing the '1.234' value field:
(module sql
	(library sqlite)
	(main main))

(delete-file "test.db")
(define *db* (instantiate::sqlite (path "test.db")))

(define (main args)
  (sqlite-exec *db* "CREATE TABLE table1 (id INTEGER, name TEXT, value REAL)")

  (sqlite-exec *db* "INSERT INTO table1 (id, name) VALUES (1, 'first')")
  (pp (sqlite-map *db* vector "SELECT * FROM table1"))
  ;; prints (#("1" "first" #unspecified))

  (sqlite-exec *db* "INSERT INTO table1 (id, name, value) VALUES (2, 'second', 1.234)")
  (pp (sqlite-map *db* vector "SELECT * FROM table1"))
  ;; *** ERROR:parser:
  ;; parse error (unexpected token `DOT') -- (DOT #{loc [string] 60})
  )

2) The databases I create using bigloo aren't recognized by sqlite3.  I get:

$ sqlite3 test.db
SQLite version 3.5.9
Enter ".help" for instructions
sqlite> .tables
Error: file is encrypted or is not a database
(Continue reading)

Cyprien Nicolas | 16 Jul 23:00
Picon

Re: sqlite

Hello wr

I can't reproduce it..., but I'm using bigloo3.1b and sqlite 3.4.2
Did you try with the last beta ?
There is nothing in the ChangeLog between 3.1a and 3.1b about the
sqlite library...

I will try tomorrow with 3.1a release

Here is the output i got

[cnicolas <at> lhost tmp]$ bigloo test.scm && ./a.out
(#("1" "first" #unspecified))
(#("1" "first" #unspecified)
 #("2" "second" "1.234"))
[cnicolas <at> lhost tmp]$ sqlite3 test.db
SQLite version 3.4.2
Enter ".help" for instructions
sqlite> .tables
table1
sqlite> .exit

2008/7/16 w r <wrloan2000 <at> yahoo.com>:
> I'm experimenting with the sqlite interface (bigloo 3.1a on linux), and ran into 2 issues:
>
> 1) This code gets an error parsing the '1.234' value field:
> (module sql
>        (library sqlite)
>        (main main))
>
(Continue reading)

Cyprien Nicolas | 17 Jul 11:38
Picon

Re: sqlite

I have just tried with 3.1a, and i didn't get any error, with sqlite 3.4.2

Maybe you could try to fill the table with sqlite3 cli, and try to
query it with bigloo...

Cyprien

2008/7/16 Cyprien Nicolas <c.nicolas <at> gmail.com>:
> Hello wr
>
> I can't reproduce it..., but I'm using bigloo3.1b and sqlite 3.4.2
> Did you try with the last beta ?
> There is nothing in the ChangeLog between 3.1a and 3.1b about the
> sqlite library...
>
> I will try tomorrow with 3.1a release
>
> Here is the output i got
>
> [cnicolas <at> lhost tmp]$ bigloo test.scm && ./a.out
> (#("1" "first" #unspecified))
> (#("1" "first" #unspecified)
>  #("2" "second" "1.234"))
> [cnicolas <at> lhost tmp]$ sqlite3 test.db
> SQLite version 3.4.2
> Enter ".help" for instructions
> sqlite> .tables
> table1
> sqlite> .exit
>
(Continue reading)

w r | 17 Jul 15:12
Picon
Favicon

Re: sqlite

I recompiled bigloo, problems fixed!

Looks like the issue was caused by originally compiling bigloo before
installing sqlite3.  Thanks for your help.

Wayne

--- On Thu, 7/17/08, Cyprien Nicolas <c.nicolas <at> gmail.com> wrote:

> From: Cyprien Nicolas <c.nicolas <at> gmail.com>
> Subject: Re: [bigloo] sqlite
> To: wrloan2000 <at> yahoo.com
> Cc: "bigloo" <bigloo <at> sophia.inria.fr>
> Date: Thursday, July 17, 2008, 5:38 AM
> I have just tried with 3.1a, and i didn't get any error,
> with sqlite 3.4.2
> 
> Maybe you could try to fill the table with sqlite3 cli, and
> try to
> query it with bigloo...
> 
> Cyprien
> 
> 
> 2008/7/16 Cyprien Nicolas <c.nicolas <at> gmail.com>:
> > Hello wr
> >
> > I can't reproduce it..., but I'm using
> bigloo3.1b and sqlite 3.4.2
> > Did you try with the last beta ?
(Continue reading)

Manuel.Serrano | 21 Jul 12:19
Picon
Picon

Re: sqlite

Hello Wayne,

> I'm experimenting with the sqlite interface (bigloo 3.1a on linux), and ran into 2 issues:
> 
> 1) This code gets an error parsing the '1.234' value field:
> (module sql
> 	(library sqlite)
> 	(main main))
> 
> (delete-file "test.db")
> (define *db* (instantiate::sqlite (path "test.db")))
> 
> (define (main args)
>   (sqlite-exec *db* "CREATE TABLE table1 (id INTEGER, name TEXT, value REAL)")
> 
>   (sqlite-exec *db* "INSERT INTO table1 (id, name) VALUES (1, 'first')")
>   (pp (sqlite-map *db* vector "SELECT * FROM table1"))
>   ;; prints (#("1" "first" #unspecified))
> 
>   (sqlite-exec *db* "INSERT INTO table1 (id, name, value) VALUES (2, 'second', 1.234)")
>   (pp (sqlite-map *db* vector "SELECT * FROM table1"))
>   ;; *** ERROR:parser:
>   ;; parse error (unexpected token `DOT') -- (DOT #{loc [string] 60})
>   )
> 
> 2) The databases I create using bigloo aren't recognized by sqlite3.  I get:
> 
> $ sqlite3 test.db
> SQLite version 3.5.9
> Enter ".help" for instructions
(Continue reading)


Gmane