Stephane Ducasse wrote:
Do you have the same bug in 5.0?
Because I do not know if garage was really tested on 60.

Don't know (don't have it), but last commit in Garage-SQLite GuillermoPolito.26 from 2016. The mentioned #nbBindingOf: is sent at no place at all in the image (except supersend in the lone method itself), so it definitely looks like it need to rename to ffiBindingOf: for 60.

Herby


Stef

On Sun, Aug 13, 2017 at 8:41 PM, Herby Vojčík<he...@mailbox.sk>  wrote:
Stephane Ducasse wrote:
Hi Herby

On which version of Pharo are you trying? Because lot of changes
happened on Pharo 60 FFI.

Stef

On Sun, Aug 13, 2017 at 6:11 PM, Herby Vojčík<he...@mailbox.sk>   wrote:
Hello!

This testing code:

| databaseFile login accessor sqlString |
          databaseFile := Smalltalk imageDirectory asFileReference /
'play.sqlite'.
          login := Login new
                          database: SQLite3Platform new;
                          host: '';
                          port: '';
                          username: '';
                          password: '';
                          databaseName: databaseFile fullPath asZnUrl
asString;
                          yourself.
          accessor := DatabaseAccessor forLogin: login.
          accessor login.
          sqlString := 'SELECT * FROM AGENT'.
          (accessor basicExecuteSQLString: sqlString) contents inspect.

fails (Pharo 6.1, GarageGlorp #stable loaded a week ago as a project

As I wrote here, Pharo 6.1.


dependency) with:

Error: Unable to resolve external type: sqlite3

FFICallout(Object)>>error:
FFICallout>>resolveType:
FFICallout>>typeName:pointerArity:
FFICallout>>argName:indirectIndex:type:ptrArity:
FFIFunctionParser>>parseArgument
FFIFunctionParser>>parseArguments
FFIFunctionParser>>parseNamedFunction:
FFICalloutMethodBuilder>>parseSignature:
FFICalloutMethodBuilder>>generate
FFICalloutMethodBuilder>>build:
FFICalloutAPI>>function:module:
GASqlite3FFI(Object)>>ffiCall:module:
GASqlite3FFI>>apiErrorMessage:
GASqlite3FFI>>signal:with:on:
GASqlite3FFI>>checkForOk:on:
GASqlite3FFI>>prepare:on:with:
GASqlite3Statement>>prepare
GASqlite3Driver>>prepare:
GASqlite3ResultSet>>prepareStatement:
GASqlite3ResultSet>>execute:withCollection:
GASqlite3ResultSet>>execute:with:on:
GASqlite3Driver>>execute:with:
GASqlite3Driver>>execute:
GAGlorpDriver>>basicExecuteSQLString:
PharoDatabaseAccessor>>basicExecuteSQLString:
UndefinedObject>>DoIt
OpalCompiler>>evaluate
[..snip..]

Problem seems to be that in FFICallout>>   resolveType:, the line

binding := resolver ffiBindingOf: name asSymbol.

actually produces nil, resolver being GASqlite3FFI class. If looking at
the
class side of GaSqlite3FFI, there is no ffiBindingOf: at all; there is

nbBindingOf: aTypeName
          ^ TypeMap at: aTypeName ifAbsent: [ super nbBindingOf: aTypeName
]

though. If I copy near-mindlessly and add:

ffiBindingOf: aTypeName
          ^ TypeMap at: aTypeName ifAbsent: [ super ffiBindingOf:
aTypeName ]

then the code above fails correctly with: 'no such table: AGENT'.

Am I missing some nb<->ffi bridge? Or is there a bug in Garage SQLite
driver?

Herby




Reply via email to