Description
How can you increase the library's usage and contributions?
Problem
You are limiting the library's usage and contributions by using an internal
package and unexported functions.
dbgo
uses a modified version of jet
to interpret a Go file and output type-safe SQL.
Here are the issues experienced while implementing this functionality:
- Use of
internal
: Usingjet
programmatically with an interpreter requires you to use functions which referenceinternal
, when functions in aninternal
package cannot be referenced. So, the developer must rename the entireinternal
package to usejet
with an interpreter. - Unexported functions
genTemplate
is unexported which requires the developer to inline a definition or export the function to usejet
programmatically.postgres
package contains unexported functions which requires the developer to export them when usingjet
with an interpreter.
Implementation
You can increase the library's usage and contributions by replacing the internal
package and exporting certain unexported functions.
https://github.com/switchupcb/jet/tree/dbgo is a version of jet
which has these problems fixed for PostgreSQL functionality.
Implementation: Internal Usage
The solution to this problem requires further discussion among maintainers.
Implementation: Export Unexported Functions
You can approve the decision to export unexported fuinctions required for usage of jet
in an interpreter (e.g., functions in import "github.com/go-jet/jet/v2/postgres"
) and I can create a pull request to solve this problem.
Here are example commits: