Skip to content

Commit

Permalink
expose the libsql_close_hook to loadable extensions
Browse files Browse the repository at this point in the history
libsql_close_hook was added here in tursodatabase#219 but it is not available to loadable extensions.

Following the same pattern was was done for `wal_methods_unregister` (tursodatabase@47e59b7) to expose this to loadable extensions.

- Will be used in tursodatabase#434 to do cleanup of cr-sqlite
  • Loading branch information
tantaman committed Sep 29, 2023
1 parent 4dc41b8 commit 3ceb251
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sqlite3ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ struct libsql_api_routines {
struct libsql_wal_methods *(*wal_methods_find)(const char *);
int (*wal_methods_register)(struct libsql_wal_methods*);
int (*wal_methods_unregister)(struct libsql_wal_methods*);
void *(*close_hook)(sqlite3, void(*)(void*,sqlite3*), void *pArg);
};

/*
Expand Down Expand Up @@ -705,6 +706,7 @@ typedef int (*sqlite3_loadext_entry)(
#define libsql_wal_methods_find libsql_api->wal_methods_find
#define libsql_wal_methods_register libsql_api->wal_methods_register
#define libsql_wal_methods_unregister libsql_api->wal_methods_unregister
#define libsql_close_hook libsql_api->close_hook
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */

#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
Expand Down

0 comments on commit 3ceb251

Please sign in to comment.