mattn / mattn/go-sqlite3

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

Open
#1,266 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
9.2k
Forks
1.2k
Avg merge
19m
Merged PRs (30d)
4

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open sqlite3-binding.c and locate the forward declarations, extension initializer array, and extension initializer function sections described in the issue. Add the proposed CUSTOM_EXTENSIONS guidance comments at those three locations, then inspect the resulting file to confirm the placeholders clearly identify where external developers should add their code.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, go, sqlite
Domain
database, documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.