SQL support from GLASS

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

SQL support from GLASS

dario trussardi
Ciao,

        i need to do demo how to interface GLASS  with SQL database.

        Can someone help me to understand the state of the art in this regard?

        Thanks for any considerations,

                Dario
Reply | Threaded
Open this post in threaded view
|

Re: SQL support from GLASS

Dale Henrichs
Dario,

As far as SQL database connectivity goes, we have a commercial product called GemConnect[1] that provides connectivity to Oracle.

Other than that I suppose that something like DBXTalk can be ported to GemStone ... I haven't looked at DBXTalk, but at least with the FFI support GemStone 3.x it should be easier to get the port working...

Dale

[1] http://community.gemstone.com/display/GSS64/GemConnect+2.2.x+Documentation
[2] http://dbxtalk.smallworks.com.ar/

----- Original Message -----
| From: "Dario Trussardi" <[hidden email]>
| To: "beta discussion Gemstone Seaside" <[hidden email]>
| Sent: Saturday, March 23, 2013 5:26:35 AM
| Subject: [GS/SS Beta] SQL support from GLASS
|
| Ciao,
|
| i need to do demo how to interface GLASS  with SQL database.
|
| Can someone help me to understand the state of the art in this regard?
|
| Thanks for any considerations,
|
| Dario
|
Reply | Threaded
Open this post in threaded view
|

Re: SQL support from GLASS

dario trussardi
Dale,

As far as SQL database connectivity goes, we have a commercial product called GemConnect[1] that provides connectivity to Oracle.

Other than that I suppose that something like DBXTalk can be ported to GemStone ... I haven't looked at DBXTalk, but at least with the FFI support GemStone 3.x it should be easier to get the port working...

Dale

[1] http://community.gemstone.com/display/GSS64/GemConnect+2.2.x+Documentation
[2] http://dbxtalk.smallworks.com.ar/

----- Original Message -----
| From: "Dario Trussardi" <[hidden email]>
| To: "beta discussion Gemstone Seaside" <[hidden email]>
| Sent: Saturday, March 23, 2013 5:26:35 AM
| Subject: [GS/SS Beta] SQL support from GLASS
|
| Ciao,
|
| i need to do demo how to interface GLASS  with SQL database.
|
| Can someone help me to understand the state of the art in this regard?
|
| Thanks for any considerations,
|
| Dario
|


I do some test for integrate DBXTalk


I do not know too much about gemstone. But I'm pretty sure it includes metacello. You can try evaluating the following expression to install opendbx 1.2:

Gofer it
    package: 'ConfigurationOfOpenDBXDriver';
    load.

I load it into Gemstone.

When execute:


((Smalltalk at: #ConfigurationOfOpenDBXDriver) project version: '1.2') load.

the system answer:

'a Halt occurred (error 2709), Debug Warning: Warning: The following definitions had errors while loading.  Press Proceed to try to load them again (they may work on a second pass):
  OpenDBXUnix>>apiBind:database:name:password:method:
  OpenDBXUnix>>apiError:number:
  OpenDBXUnix>>apiErrorType:number:
  OpenDBXUnix>>apiFinalize:
  OpenDBXUnix>>apiGetOption:option:value:
  OpenDBXUnix>>apiInitialize:backend:host:port:
  OpenDBXUnix>>apiOpenLarge:handle:value:
  OpenDBXUnix>>apiQuery:query:length:
  OpenDBXUnix>>apiQueryColumnLength:index:
  OpenDBXUnix>>apiQueryColumnName:index:
  OpenDBXUnix>>apiQueryColumns:
  OpenDBXUnix>>apiQueryColumnType:index:
  OpenDBXUnix>>apiQueryFetchRow:
  OpenDBXUnix>>apiQueryFieldValue:index:
  OpenDBXUnix>>apiQueryFinalize:
  OpenDBXUnix>>apiQueryResult:handle:timeout:chunk:
  OpenDBXUnix>>apiQueryRowsAffected:
  OpenDBXUnix>>apiSetOption:option:value:
  OpenDBXUnix>>apiUnbind:
  OpenDBXWin32>>apiBind:database:name:password:method:
  OpenDBXWin32>>apiError:number:
  OpenDBXWin32>>apiErrorType:number:
  OpenDBXWin32>>apiFinalize:
  OpenDBXWin32>>apiGetOption:option:value:
  OpenDBXWin32>>apiInitialize:backend:host:port:
  OpenDBXWin32>>apiOpenLarge:handle:value:
  OpenDBXWin32>>apiQuery:query:length:
  OpenDBXWin32>>apiQueryColumnLength:index:
  OpenDBXWin32>>apiQueryColumnName:index:
  OpenDBXWin32>>apiQueryColumns:
  OpenDBXWin32>>apiQueryColumnType:index:
  OpenDBXWin32>>apiQueryFetchRow:
  OpenDBXWin32>>apiQueryFieldValue:index:
  OpenDBXWin32>>apiQueryFinalize:
  OpenDBXWin32>>apiQueryResult:handle:timeout:chunk:
  OpenDBXWin32>>apiQueryRowsAffected:
  OpenDBXWin32>>apiSetOption:option:value:
  OpenDBXWin32>>apiUnbind:
'





Proceeding the system report:

'Compile error in Class: #''OpenDBXUnix'' method: apiBind: handle database: databaseName name: userName password: password method: method "int odbx_bind(odbx_t* handle, const char* database, const char* who, const char* cred,int method )" <cdecl: long ''odbx_bind'' (ulong char* char* char* ulong) module: ''opendbx''> * ^1 ^self externalCallFailed 1: [1034] unexpected token '



I think "opendbx" as comment is not correct

By Guillermo Polito:

Ok, when loading OpenDBX in pharo, I get the following method:

OpenDBXUnix>>apiBind: handle database: databaseName name: userName password: password method: method
"int odbx_bind(odbx_t* handle, const char* database, const char* who, const char* cred,int method )"
<cdecl: long 'odbx_bind' (ulong char* char* char* ulong) module: 'opendbx'>
^self externalCallFailed

So, there is not really a comment in there :/. Maybe asking in some Gemstone mailing list?

I reversal the question.

Thanks,

Dario



Reply | Threaded
Open this post in threaded view
|

Re: SQL support from GLASS

Mariano Martinez Peck
Hi Dario,

The main difference in the port of DBXTalk to Gemstone is that FFI part. Fortunately, DBXTalk design makes it easy to adapt.
Just make your own subclasses of OpenDBX class. Right now we have PharoOpenDBX and its subclasses OpenDBXUnix and OpenDBXWin32.
You should create a subclass of OpenDBX called GemstonOpenDBX or something like that, and implement all the API methods (abstract methods in OpenDBX class) to use Gemstone FFI instead of the Pharo FFI. Of course, you could also copy/paste/modify the PharoOpenDBX subclasses and change them for Gemstone FFI.

My recommendation is to ask in Gemstone mailing list which is the equivalent FFI version of one particular example, like odbx_bind. And then you write the rest. 

Let me know how it works. I would really love to have DBXTalk working on Gemstone. 
Keep us informed, 


On Thu, Apr 4, 2013 at 11:05 AM, Dario Trussardi <[hidden email]> wrote:
Dale,

As far as SQL database connectivity goes, we have a commercial product called GemConnect[1] that provides connectivity to Oracle.

Other than that I suppose that something like DBXTalk can be ported to GemStone ... I haven't looked at DBXTalk, but at least with the FFI support GemStone 3.x it should be easier to get the port working...

Dale

[1] http://community.gemstone.com/display/GSS64/GemConnect+2.2.x+Documentation
[2] http://dbxtalk.smallworks.com.ar/

----- Original Message -----
| From: "Dario Trussardi" <[hidden email]>
| To: "beta discussion Gemstone Seaside" <[hidden email]>
| Sent: Saturday, March 23, 2013 5:26:35 AM
| Subject: [GS/SS Beta] SQL support from GLASS
|
| Ciao,
|
| i need to do demo how to interface GLASS  with SQL database.
|
| Can someone help me to understand the state of the art in this regard?
|
| Thanks for any considerations,
|
| Dario
|


I do some test for integrate DBXTalk


I do not know too much about gemstone. But I'm pretty sure it includes metacello. You can try evaluating the following expression to install opendbx 1.2:

Gofer it
    package: 'ConfigurationOfOpenDBXDriver';
    load.

I load it into Gemstone.

When execute:


((Smalltalk at: #ConfigurationOfOpenDBXDriver) project version: '1.2') load.

the system answer:

'a Halt occurred (error 2709), Debug Warning: Warning: The following definitions had errors while loading.  Press Proceed to try to load them again (they may work on a second pass):
  OpenDBXUnix>>apiBind:database:name:password:method:
  OpenDBXUnix>>apiError:number:
  OpenDBXUnix>>apiErrorType:number:
  OpenDBXUnix>>apiFinalize:
  OpenDBXUnix>>apiGetOption:option:value:
  OpenDBXUnix>>apiInitialize:backend:host:port:
  OpenDBXUnix>>apiOpenLarge:handle:value:
  OpenDBXUnix>>apiQuery:query:length:
  OpenDBXUnix>>apiQueryColumnLength:index:
  OpenDBXUnix>>apiQueryColumnName:index:
  OpenDBXUnix>>apiQueryColumns:
  OpenDBXUnix>>apiQueryColumnType:index:
  OpenDBXUnix>>apiQueryFetchRow:
  OpenDBXUnix>>apiQueryFieldValue:index:
  OpenDBXUnix>>apiQueryFinalize:
  OpenDBXUnix>>apiQueryResult:handle:timeout:chunk:
  OpenDBXUnix>>apiQueryRowsAffected:
  OpenDBXUnix>>apiSetOption:option:value:
  OpenDBXUnix>>apiUnbind:
  OpenDBXWin32>>apiBind:database:name:password:method:
  OpenDBXWin32>>apiError:number:
  OpenDBXWin32>>apiErrorType:number:
  OpenDBXWin32>>apiFinalize:
  OpenDBXWin32>>apiGetOption:option:value:
  OpenDBXWin32>>apiInitialize:backend:host:port:
  OpenDBXWin32>>apiOpenLarge:handle:value:
  OpenDBXWin32>>apiQuery:query:length:
  OpenDBXWin32>>apiQueryColumnLength:index:
  OpenDBXWin32>>apiQueryColumnName:index:
  OpenDBXWin32>>apiQueryColumns:
  OpenDBXWin32>>apiQueryColumnType:index:
  OpenDBXWin32>>apiQueryFetchRow:
  OpenDBXWin32>>apiQueryFieldValue:index:
  OpenDBXWin32>>apiQueryFinalize:
  OpenDBXWin32>>apiQueryResult:handle:timeout:chunk:
  OpenDBXWin32>>apiQueryRowsAffected:
  OpenDBXWin32>>apiSetOption:option:value:
  OpenDBXWin32>>apiUnbind:
'





Proceeding the system report:

'Compile error in Class: #''OpenDBXUnix'' method: apiBind: handle database: databaseName name: userName password: password method: method "int odbx_bind(odbx_t* handle, const char* database, const char* who, const char* cred,int method )" <cdecl: long ''odbx_bind'' (ulong char* char* char* ulong) module: ''opendbx''> * ^1 ^self externalCallFailed 1: [1034] unexpected token '



I think "opendbx" as comment is not correct

By Guillermo Polito:

Ok, when loading OpenDBX in pharo, I get the following method:

OpenDBXUnix>>apiBind: handle database: databaseName name: userName password: password method: method
"int odbx_bind(odbx_t* handle, const char* database, const char* who, const char* cred,int method )"
<cdecl: long 'odbx_bind' (ulong char* char* char* ulong) module: 'opendbx'>
^self externalCallFailed

So, there is not really a comment in there :/. Maybe asking in some Gemstone mailing list?

I reversal the question.

Thanks,

Dario






--
Mariano
http://marianopeck.wordpress.com
Reply | Threaded
Open this post in threaded view
|

Re: SQL support from GLASS

Dale Henrichs
Mariano and Dario,

If I'm not mistaken (I haven't had the opportunity to get my hands dirty with the new FFI interface, yet:) you feed the FFI interface .h files and Smalltalk code is generated ...

James, could you shed some light here? I'm sure this is all spelled out in the documentation, but a brief overview would probably be helpful.

Dale

----- Original Message -----
| From: "Mariano Martinez Peck" <[hidden email]>
| To: "GemStone Seaside beta discussion" <[hidden email]>, [hidden email]
| Sent: Thursday, April 4, 2013 7:24:31 AM
| Subject: Re: [GS/SS Beta] SQL support from GLASS
|
| Hi Dario,
|
| The main difference in the port of DBXTalk to Gemstone is that FFI part.
| Fortunately, DBXTalk design makes it easy to adapt.
| Just make your own subclasses of OpenDBX class. Right now we
| have PharoOpenDBX and its subclasses OpenDBXUnix and OpenDBXWin32.
| You should create a subclass of OpenDBX called GemstonOpenDBX or something
| like that, and implement all the API methods (abstract methods in OpenDBX
| class) to use Gemstone FFI instead of the Pharo FFI. Of course, you could
| also copy/paste/modify the PharoOpenDBX subclasses and change them for
| Gemstone FFI.
|
| My recommendation is to ask in Gemstone mailing list which is the
| equivalent FFI version of one particular example, like odbx_bind. And then
| you write the rest.
|
| Let me know how it works. I would really love to have DBXTalk working on
| Gemstone.
| Keep us informed,
|
|
| On Thu, Apr 4, 2013 at 11:05 AM, Dario Trussardi <[hidden email]
| > wrote:
|
| > Dale,
| >
| > As far as SQL database connectivity goes, we have a commercial product
| > called GemConnect[1] that provides connectivity to Oracle.
| >
| > Other than that I suppose that something like DBXTalk can be ported to
| > GemStone ... I haven't looked at DBXTalk, but at least with the FFI support
| > GemStone 3.x it should be easier to get the port working...
| >
| > Dale
| >
| > [1]
| > http://community.gemstone.com/display/GSS64/GemConnect+2.2.x+Documentation
| > [2] http://dbxtalk.smallworks.com.ar/
| >
| > ----- Original Message -----
| > | From: "Dario Trussardi" <[hidden email]>
| > | To: "beta discussion Gemstone Seaside" <[hidden email]>
| > | Sent: Saturday, March 23, 2013 5:26:35 AM
| > | Subject: [GS/SS Beta] SQL support from GLASS
| > |
| > | Ciao,
| > |
| > | i need to do demo how to interface GLASS  with SQL database.
| > |
| > | Can someone help me to understand the state of the art in this regard?
| > |
| > | Thanks for any considerations,
| > |
| > |  Dario
| > |
| >
| >
| >
| > I do some test for integrate DBXTalk
| >
| >
| > I do not know too much about gemstone. But I'm pretty sure it includes
| > metacello. You can try evaluating the following expression to install
| > opendbx 1.2:
| >
| > Gofer it
| >     url: 'http://www.smalltalkhub.com/mc/DBXTalk/DBXTalkDriver/main';
| >     package: 'ConfigurationOfOpenDBXDriver';
| >     load.
| >
| >
| > I load it into Gemstone.
| >
| > When execute:
| >
| >
| > ((Smalltalk at: #ConfigurationOfOpenDBXDriver) project version: '1.2')
| > load.
| >
| >
| > the system answer:
| >
| > 'a Halt occurred (error 2709), Debug Warning: Warning: The following
| > definitions had errors while loading.  Press Proceed to try to load them
| > again (they may work on a second pass):
| >   OpenDBXUnix>>apiBind:database:name:password:method:
| >   OpenDBXUnix>>apiError:number:
| >   OpenDBXUnix>>apiErrorType:number:
| >   OpenDBXUnix>>apiFinalize:
| >   OpenDBXUnix>>apiGetOption:option:value:
| >   OpenDBXUnix>>apiInitialize:backend:host:port:
| >   OpenDBXUnix>>apiOpenLarge:handle:value:
| >   OpenDBXUnix>>apiQuery:query:length:
| >   OpenDBXUnix>>apiQueryColumnLength:index:
| >   OpenDBXUnix>>apiQueryColumnName:index:
| >   OpenDBXUnix>>apiQueryColumns:
| >   OpenDBXUnix>>apiQueryColumnType:index:
| >   OpenDBXUnix>>apiQueryFetchRow:
| >   OpenDBXUnix>>apiQueryFieldValue:index:
| >   OpenDBXUnix>>apiQueryFinalize:
| >   OpenDBXUnix>>apiQueryResult:handle:timeout:chunk:
| >   OpenDBXUnix>>apiQueryRowsAffected:
| >   OpenDBXUnix>>apiSetOption:option:value:
| >   OpenDBXUnix>>apiUnbind:
| >   OpenDBXWin32>>apiBind:database:name:password:method:
| >   OpenDBXWin32>>apiError:number:
| >   OpenDBXWin32>>apiErrorType:number:
| >   OpenDBXWin32>>apiFinalize:
| >   OpenDBXWin32>>apiGetOption:option:value:
| >   OpenDBXWin32>>apiInitialize:backend:host:port:
| >   OpenDBXWin32>>apiOpenLarge:handle:value:
| >   OpenDBXWin32>>apiQuery:query:length:
| >   OpenDBXWin32>>apiQueryColumnLength:index:
| >   OpenDBXWin32>>apiQueryColumnName:index:
| >   OpenDBXWin32>>apiQueryColumns:
| >   OpenDBXWin32>>apiQueryColumnType:index:
| >   OpenDBXWin32>>apiQueryFetchRow:
| >   OpenDBXWin32>>apiQueryFieldValue:index:
| >   OpenDBXWin32>>apiQueryFinalize:
| >   OpenDBXWin32>>apiQueryResult:handle:timeout:chunk:
| >   OpenDBXWin32>>apiQueryRowsAffected:
| >   OpenDBXWin32>>apiSetOption:option:value:
| >   OpenDBXWin32>>apiUnbind:
| > '
| >
| >
| >
| >
| >
| > Proceeding the system report:
| >
| > 'Compile error in Class: #''OpenDBXUnix'' method: apiBind: handle
| > database: databaseName name: userName password: password method: method
| > "int odbx_bind(odbx_t* handle, const char* database, const char* who, const
| > char* cred,int method )" <cdecl: long ''odbx_bind'' (ulong char* char*
| > char* ulong) module: ''opendbx''> * ^1 ^self externalCallFailed 1: [1034]
| > unexpected token '
| >
| >
| >
| > I think "opendbx" as comment is not correct
| >
| >
| > By Guillermo Polito:
| >
| > Ok, when loading OpenDBX in pharo, I get the following method:
| >
| > OpenDBXUnix>>apiBind: handle database: databaseName name: userName
| > password: password method: method
| > "int odbx_bind(odbx_t* handle, const char* database, const char* who,
| > const char* cred,int method )"
| > <cdecl: long 'odbx_bind' (ulong char* char* char* ulong) module: 'opendbx'>
| > ^self externalCallFailed
| >
| > So, there is not really a comment in there :/. Maybe asking in some
| > Gemstone mailing list?
| >
| >
| > I reversal the question.
| >
| > Thanks,
| >
| > Dario
| >
| >
| >
| >
|
|
| --
| Mariano
| http://marianopeck.wordpress.com
|
Reply | Threaded
Open this post in threaded view
|

Re: SQL support from GLASS

James Foster-8
CHeader>>#'wrapperNamed:forLibraryAt:select:' contains the following example as its comment:

| header class |
UserGlobals removeKey: #'GciLibrary' ifAbsent: [].
header := CHeader path: '$GEMSTONE/include/gci.hf'.
class := header
        wrapperNamed: 'GciLibrary'
        forLibraryAt: self class fetchGciRpcLibraryName
        select: [:each | each name first = $G].
class initializeFunctions.
UserGlobals at: class name put: class.


At this point you can instantiate an instance of the library and send it messages.

James

----- Original Message -----
From: "Dale Henrichs" <[hidden email]>
To: "GemStone Seaside beta discussion" <[hidden email]>
Cc: [hidden email]
Sent: Thursday, April 4, 2013 7:51:02 AM
Subject: Re: [GS/SS Beta] SQL support from GLASS

Mariano and Dario,

If I'm not mistaken (I haven't had the opportunity to get my hands dirty with the new FFI interface, yet:) you feed the FFI interface .h files and Smalltalk code is generated ...

James, could you shed some light here? I'm sure this is all spelled out in the documentation, but a brief overview would probably be helpful.

Dale