Re: [GS/SS Beta] SQL support from GLASS

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

Re: [GS/SS Beta] 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

--
You received this message because you are subscribed to the Google Groups "DBXTalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.