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

Language Driver Request for Golang #627

Open
farost opened this issue Apr 5, 2024 · 3 comments
Open

Language Driver Request for Golang #627

farost opened this issue Apr 5, 2024 · 3 comments

Comments

@farost
Copy link
Member

farost commented Apr 5, 2024

Golang (or just Go) is a popular language and many Go developers could benefit from using TypeDB driver in their code. Considering the already existing instruments we usually want to see for a target language for our drivers, it seems to be a good aim for us.

SWIG to use our native C functions: check (pay attention to the memory management and how it wraps arrays, some typemaps could be found from the official repo).

Bazel rules: check.

Cucumber lib for BDD: check(official!).

@farost
Copy link
Member Author

farost commented May 20, 2024

The basic checklist, it could be updated with new details in the future:

Base questions:

  • Define Go version (check what versions are the most popular and still supported by the devs now, are they backwards-compatible, what version of Go to use for the driver to cover the most part of the Go community)

Initial Bazel setup:

  • Connect Bazel: build and run a sample "Hello, world!" application in Go using Bazel
  • Split the "Hello, world" app into a lib and a binary using Bazel, connect them together
  • Define the differences between embedding libs into binaries and adding them as dependencies
  • Add an automatic test using the go_test rule
  • Gazelle - what is it for? Do we need to use it?
  • Define how to specify Go version for libs/binaries
  • Test if an application of an older Go version can add a package developed on a newer Go version

Initial BDD setup:

  • Add BDD (the Cucumber lib mentioned in the description) library to the Bazel build
  • Test adding external libraries to the project (the Cucumber lib)
  • build and run a sample BDD test using Bazel

Initial SWIG setup:

  • Try SWIG: generate Go-wrappers using swig and the C driver headers manually, explore the content of it

Connection implementation step:

  • Connect SWIG generation with Bazel: write additional rules to get the native library for Go, and test it by adding a TypeDB native call into the "Hello, world!" app
  • Implement Connection for the driver: database manager, session + transaction manipulations
  • Implement Connection BDD tests to cover the previously written code

Implementation finish:

  • Implement the remainder of the driver and BDD tests
  • Implement integration tests for code samples (check C# examples)
  • Define the distribution process
  • Implement CI/CD
  • Implement documentation generation
  • Release

@nickan2c
Copy link
Contributor

Choice of Go Version is 1.21 (Go releases)

  • This is the lowest, currently supported release of Go, and it supports a large number of packages. Go only supports the two most recently released packages, and releases happen every 6 months.
  • Go supports backwards compatibility entirely until this release, and it breaks it slightly in release 1.22, so this will support our users and should cover most of the Go community.

@farost
Copy link
Member Author

farost commented May 22, 2024

Publishing: https://go.dev/doc/modules/developing

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

No branches or pull requests

2 participants