Newbie question: Connection to SQLite DB

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie question: Connection to SQLite DB

gerard alis
I´m cannot connect a sample SQLite DB. I´m sure need some steps but I don´t know exactly.
Really I have alway problems when I try execute some external to Smalltalk image. Exists a document with global information of that?

I did install SQueakDBX (with problems for #and:and:and: deprecated method of boolean), but the system launch a error when I try create and open the connection to DB. Looking in SqueakSource appears too a SQLite project ( SQLite3-Core and SQLite3-Tests ) but I get the same error... I understand the problem is for FFI... but I don´t understand what is the cause...

Is needed something more for run FFI?

Thanks for the help.
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: Connection to SQLite DB

Levente Uzonyi-2
On Mon, 4 Oct 2010, nullPointer wrote:

>
I´m cannot connect a sample SQLite DB. I´m sure need some steps but I don´t
know exactly.
Really I have alway problems when I try execute some external to Smalltalk
image. Exists a document with global information of that?

I did install SQueakDBX (with problems for #and:and:and: deprecated method
of boolean), but the system launch a error when I try create and open the
connection to DB. Looking in SqueakSource appears too a SQLite project (
SQLite3-Core and SQLite3-Tests ) but I get the same error... I understand
the problem is for FFI... but I don´t understand what is the cause...

Is needed something more for run FFI?


You have to install the FFI package.


Levente


Thanks for the help.
--
View this message in context: http://forum.world.st/Newbie-question-Connection-to-SQLite-DB-tp2954195p2954195.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: Connection to SQLite DB

gerard alis
Well, I first install Sqlite project; I add ConfigurationOfSQLite3 to image. Later:

       (ConfigurationOfSQLite3 project version: '1.1') load.

That seems load Sqlite3 classes and dependences too, FFI included. But if I try execute one example of FFI I get an error. For example:

       Win32Window win32Draw

Now I´m using Windows7 but fails me too Mac Snow Leopard OS...


I´m very lost on that subject...

Regards

Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: Connection to SQLite DB

Mariano Martinez Peck
In reply to this post by gerard alis


On Mon, Oct 4, 2010 at 2:07 PM, nullPointer <[hidden email]> wrote:

I´m cannot connect a sample SQLite DB. I´m sure need some steps but I don´t
know exactly.
Really I have alway problems when I try execute some external to Smalltalk
image. Exists a document with global information of that?

I did install SQueakDBX (with problems for #and:and:and: deprecated method
of boolean),

How did you install SqueakDBX?  Becasue this should not happen.


Gofer new
    squeaksource: 'MetacelloRepository';
    package: 'ConfigurationOfSqueakDBX';
    load.

((Smalltalk at: #ConfigurationOfSqueakDBX) project version: '1.3') load.

That will load and initialize all what it is needed in the image side.
 
but the system launch a error when I try create and open the
connection to DB.

You need the opendbx and sqlite libraries.
Everything is explained here: http://www.squeakdbx.org/Compiling%20and%20installing%20OpenDBX

or here http://www.squeakdbx.org/Compiling%20for%20different%20backends

 
Looking in SqueakSource appears too a SQLite project (
SQLite3-Core and SQLite3-Tests ) but I get the same error... I understand
the problem is for FFI... but I don´t understand what is the cause...

Is needed something more for run FFI?

As far as I can see in ConfigurationOfFFI you have to do:

    (Smalltalk at: #ExternalType) initialize.
    (Smalltalk at: #ExternalStructure) compileAllFields.
    Smalltalk recreateSpecialObjectsArray


 

Thanks for the help.
--
View this message in context: http://forum.world.st/Newbie-question-Connection-to-SQLite-DB-tp2954195p2954195.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: Connection to SQLite DB

gerard alis
Mariano Martinez Peck wrote
glups! that must be the problem :|  I did install the binary sqlite on OS ( in the bin folder, correct? )
but not the OpenDBX. Anything Sqlite3 project don´t work of that way. I will try with SqueakDBX and installing OpenDBX before.

As you can see I´m very newbie on that things :(

Thanks.

Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: Connection to SQLite DB

Mariano Martinez Peck


On Mon, Oct 4, 2010 at 4:36 PM, nullPointer <[hidden email]> wrote:


Mariano Martinez Peck wrote:
>
>
> You need the opendbx and sqlite libraries.
> Everything is explained here:
> http://www.squeakdbx.org/Compiling%20and%20installing%20OpenDBX
>
> or here http://www.squeakdbx.org/Compiling%20for%20different%20backends
>
>

glups! that must be the problem :|  I did install the binary sqlite on OS (
in the bin folder, correct? )

yes
 
but not the OpenDBX. Anything Sqlite3 project don´t work of that way. I will
try with SqueakDBX and installing OpenDBX before.


in which OS are you?  if Windows, just download the dlls and put it there.
 
As you can see I´m very newbie on that things :(

Thanks.


--
View this message in context: http://forum.world.st/Newbie-question-Connection-to-SQLite-DB-tp2954195p2954436.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: Connection to SQLite DB

gerard alis
The final work must be in MacOSX... I´m searching for the existence of binary but I don´t found. Perhaps is needed compile :(

Anything, I need OpenDBX for use Sqlite3 project? ( http://squeaksource.com/@7SFD7f008dKbC-Yt/rKzITl0- )  I don´t need use glorp for the work; is for a very dummy DB.

Thanks for the help.
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: Connection to SQLite DB

Mariano Martinez Peck


On Mon, Oct 4, 2010 at 5:11 PM, nullPointer <[hidden email]> wrote:

The final work must be in MacOSX... I´m searching for the existence of binary
but I don´t found. Perhaps is needed compile :(

Yes. I don't know how to create binaries for MacOS.

So yes, I guess you should compile:

http://www.squeakdbx.org/Compiling%20for%20different%20backends/Common%20steps%20and%20problems

http://www.squeakdbx.org/Sqlite3%20for%20mac

http://www.linuxnetworks.de/doc/index.php/OpenDBX/Setup/MacOS_X

For linux I can have rpm, for Windows dll, but I have no idea for Mac. And I am a new mac user in addition.

Please feel free to ask further questions about it.



 

Anything, I need OpenDBX for use Sqlite3 project? (
http://squeaksource.com/@7SFD7f008dKbC-Yt/rKzITl0-
http://squeaksource.com/@7SFD7f008dKbC-Yt/rKzITl0-  )  I don´t need use
glorp for the work; is for a very dummy DB.


I don't get this links....what did you want to link?
 

Cheers

mariano


Thanks for the help.
--
View this message in context: http://forum.world.st/Newbie-question-Connection-to-SQLite-DB-tp2954195p2954493.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: Connection to SQLite DB

gerard alis
Mariano Martinez Peck wrote
> Anything, I need OpenDBX for use Sqlite3 project? (
> http://squeaksource.com/@7SFD7f008dKbC-Yt/rKzITl0-
> http://squeaksource.com/@7SFD7f008dKbC-Yt/rKzITl0-  )  I don´t need use
> glorp for the work; is for a very dummy DB.
>
>
I don't get this links....what did you want to link?
Is a project on SqueakSource for connect to Sqlite DBs. Excuse me for the bad link.
http://www.squeaksource.com/SQLite.html

That libs work without SqueakDBX, but obviously needs FFI. Works on Windows without problems, but in MACOSX don´t found any table on DB...  :(

Many thanks for the help.  
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: Connection to SQLite DB

Schwab,Wilhelm K
In reply to this post by gerard alis
I'm not sure I follow your concern.  The Win32 examples will certainly fail on other than Win32.  I am not even certain if they are currently expected to work on Windows (not simply a dig at its flakiness - it might have changed enough to break something).  It looks like one is expected to click a mouse button to terminate the example.  Are you matching 32 and 64 bit OS and image/vm?  What error do you get?  Posting a debug log of it might help.

Especially early in Metacello's life, I had big problems with: (1) discovering how to use a given configuration; (2) some configurations were loading things that one might not necessarily want.  An example of the latter was ConfiurationOfCitezen, which at one point loaded Seaside; it now does what one would want, leaving it to the user to load the desired version of Seaside.  You just prompted me to look at Migrate's various #load* methods, which reveals a few decisions that are no doubt incorrect or at least overly presumptuous.  I would pass along the once common advice of "just search the web" but that turns up a very dangerous mix of current and dated links.  Make sure you are using the configuration correctly.

Sorry if I am missing your point.



________________________________________
From: [hidden email] [[hidden email]] On Behalf Of nullPointer [[hidden email]]
Sent: Monday, October 04, 2010 8:27 AM
To: [hidden email]
Subject: Re: [Pharo-project] Newbie question: Connection to SQLite DB

Well, I first install Sqlite project; I add ConfigurationOfSQLite3 to image.
Later:

       (ConfigurationOfSQLite3 project version: '1.1') load.

That seems load Sqlite3 classes and dependences too, FFI included. But if I
try execute one example of FFI I get an error. For example:

       Win32Window win32Draw

Now I´m using Windows7 but fails me too Mac Snow Leopard OS...


I´m very lost on that subject...

Regards


--
View this message in context: http://forum.world.st/Newbie-question-Connection-to-SQLite-DB-tp2954195p2954215.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: Connection to SQLite DB

Mariano Martinez Peck
In reply to this post by gerard alis


On Mon, Oct 4, 2010 at 10:23 PM, nullPointer <[hidden email]> wrote:


Mariano Martinez Peck wrote:
>
>
>> Anything, I need OpenDBX for use Sqlite3 project? (
>> http://squeaksource.com/@7SFD7f008dKbC-Yt/rKzITl0-
>> http://squeaksource.com/@7SFD7f008dKbC-Yt/rKzITl0-  )  I don´t need use
>> glorp for the work; is for a very dummy DB.
>>
>>
> I don't get this links....what did you want to link?
>

Is a project on SqueakSource for connect to Sqlite DBs. Excuse me for the
bad link.
http://www.squeaksource.com/SQLite.html

That libs work without SqueakDBX, but obviously needs FFI. Works on Windows
without problems, but in MACOSX don´t found any table on DB...  :(

I will try a nice shoot:

In sqlite, the database is a "file". So, in windows, you database can be  "c:/windows/mariano/sqlite.db".
However, if sqlite doesn't find the database, sometime (I think that depending which funcion the driver is calling) Sqlite creates a database IN MEMORY.

So...MAYBE, you are using in Mac the same PATH you used in Windows, which fails, then creates an in memory database, and that explains why you don't see your tables.

ok....if it were that, you own me a beer :)

cheers

mariano
 

Many thanks for the help.

--
View this message in context: http://forum.world.st/Newbie-question-Connection-to-SQLite-DB-tp2954195p2954994.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: Connection to SQLite DB

gerard alis
Not exactly but almost.....

In Windows the image is in same directory of exe.
In MacOSX the image is on different path of exe.

When I did open the connection I did pass only the name of existent file DB, for example, "MyDB.sqlite". If the file not exists and not complete path is specified then is created in same executable directory. In windows that behavior was correct for me but in MACOSX a new BD file was saved on general Applications folder. I don´t view any table because was a new DB file...

I don´t know if I explain good, but was a sad error :(

Anyway a sample connection to Sqlite is easy with Sqlite project, and I believe is possible include a very easy mapping mechanism. It´s only for a small project and probes.

Many thanks for the help and excuse me the annoyances :)