Skip to content

Callback-scope handles: no clause presents a callback's argv (sqlite3_value **argv, argc) as &[Value] or sqlite3_user_data as the registered &U (#1611 remainder) #1779

Closed

Description

@ehartford

#1611's handle (D71, ruling Amendment 1) makes operations of a handle safe methods: the SQL-function test now calls ctx.result_int(42) with no unsafe. Two parts of an SQL function body still need unsafe, because the Amendment gives no way to express them:

  1. Reading arguments: xFunc(ctx, argc, argv) receives sqlite3_value **argv paired with argc. A clause on the registering fn item could present them as &[Value] (Value a handle) — the pairing is like D64's buffer pairing.
  2. Typed user data: sqlite3_user_data(ctx) returns the void * registered with sqlite3_create_function_v2, which the facade already boxes as the consumed U. A clause could present it as &U.

Both need a generated wrapper around the program's callback. Needs Eric's words (a modeled-C ruling amendment) before implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions