Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Inline Documentation for adding Custom Extension Functions in sqlite3-binding.c #1266

Open
jeffreyaven opened this issue Aug 6, 2024 · 0 comments

Comments

@jeffreyaven
Copy link

Background

We are using mattn/go-sqlite3 in stackql/stackql; we need to add custom extension functions specific to our program. We wouldn't expect these to be committed to this project, but we want an easy, repeatable, automated method to add our functions in a fork via a make target (like make amalgamate). We believe other developers would benefit from this capability as well.

Proposal

Inline documentation is proposed to facilitate developers' addition of custom extension functions. My approach would be to add comments within the sqlite3-binding.c file that serve as placeholders for adding custom extension functions. This would help external developers understand where to include their extension functions without requiring the maintainers of matte/go-sqlite3 to verify, test, or maintain those external functions.

Proposed Changes

1. Forward Declarations

// CUSTOM_EXTENSIONS
// 1.  Add custom extension initializer function declarations here...
// End CUSTOM_EXTENSIONS

2. Extension Initializer Array

// CUSTOM_EXTENSIONS
// 2.  Include custom extension initializer functions here...
// End CUSTOM_EXTENSIONS

3. Extension Initializer Functions

// CUSTOM_EXTENSIONS
// 3.  Add custom extension initializer functions here...
// End CUSTOM_EXTENSIONS

Benefit

These comments will provide clear guidance to developers looking to add custom extensions, helping them to understand the appropriate sections in the sqlite3-binding.c file where they should include their code.

Request

I would like to open a pull request to add these comments and would appreciate any feedback or suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant