Skip to content

Add API method Util::convert #8761

Description

@asfernandes

It's very difficult for client libraries to implement conversion of types in the same manner as implemented internally by Firebird (client
or engine). There are many complexities like conversion of floating point types and integral scaled ones, for example.

It's not sufficient to let client change message field types and let Firebird do it.

Usually, libraries have methods like getInt, getString, etc for individual columns and nobody can anticipate what the developer is going
to call. The same for setters.

Therefore I propose new utility function:

interface Util : Versioned
{
	...

	void convert(
		Status status,
		uint sourceType,
		uint sourceScale,
		uint sourceLength,
		const void* source,
		uint targetType,
		uint targetScale,
		uint targetLength,
		void* target);
}

It will be very raw, as anyone that can already read/write data to messages can use this function with buffers and read/write data to it.

It will be thin wrapper for a CVT_move call. It should not work for blobs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions