List:NDB Connectors« Previous MessageNext Message »
From:Mika Raento Date:April 24 2007 6:43am
Subject:Re: Language-specific wrappers/extensions
View as plain text  
Monty Taylor kirjoitti:
> Monty Taylor wrote:
> 
>> Maybe we should load the data dictionary at initialization time and have
>> our wrappers for equal and setValue for char* types do a lookup in the
>> data dictionary on the column type and either space pad char columns or
>> add length to the varchar columns. That could all be done once in C++ in
>> the swig file and taken advantage of by all the languages. Sound
>> reasonable? 

Using the datadict sounds good. I could imagine taking much more 
advantage of it for scripting languages in general: create a single 
NdbRecAttr::value() as well which returns the correct target language 
type for the underlying database type (including making strings out of 
aRef() and get_size_in_bytes()).

> +            memcpy(theModifiedValue,theValue,strlen(theValue));

I would like to pass in the length instead of strlen. This will make it 
possible to use with binary data which may include nulls. Most of the 
target languages already keep the length. I don't know if there's a nice 
way to split the string into data and length in SWIG or whether you need 
a small language-specific wrapper for that bit.

> 
> I haven't really tested this yet - but I thought I'd get some thoughts
> on this approach before going to far. What do you think? If you want to
> avoid the switch, you can just use setValueRaw.

I second keeping the raw interface available.

	Mika
Thread
Language-specific wrappers/extensionsMika Raento23 Apr
  • Re: Language-specific wrappers/extensionsMonty Taylor23 Apr
    • Re: Language-specific wrappers/extensionsMonty Taylor24 Apr
      • Re: Language-specific wrappers/extensionsMika Raento24 Apr
        • Re: Language-specific wrappers/extensionsMonty Taylor24 Apr
Re: Language-specific wrappers/extensionsMonty Taylor24 Apr
  • %/% rule in Makefile?Mika Raento25 Apr
    • Re: %/% rule in Makefile?Monty Taylor25 Apr
      • Re: %/% rule in Makefile?Mika Raento26 Apr
        • DocumentationMonty Taylor27 Apr
      • lifetime of Ndb and Ndb_cluster_connection objectsMika Raento26 Apr
        • Re: lifetime of Ndb and Ndb_cluster_connection objectsMonty Taylor27 Apr
          • Re: lifetime of Ndb and Ndb_cluster_connection objectsMika Raento7 May
            • Re: lifetime of Ndb and Ndb_cluster_connection objectsMonty Taylor7 May
      • Support for NdbIndex(Scan)Operation, prelim. support for typed attributeaccessMika Raento26 Apr
        • Re: Support for NdbIndex(Scan)Operation, prelim. support for typedattribute accessMonty Taylor28 Apr
Re: lifetime of Ndb and Ndb_cluster_connection objectsMonty Taylor8 May