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 support for Java bindings #613

Closed
wants to merge 25 commits into from

Conversation

seonWKim
Copy link
Contributor

@seonWKim seonWKim commented Jan 4, 2025

Purpose of this PR

  • Add support for Java (as Java has an extensive community)
  • Enable Limbo to be provided as a Java library in the future.

Changes

  • Added bindings/java directory.
  • Created src package for Java (Gradle) and rs_src for Rust JNI code.
  • Implemented basic functionality to gather feedback and proceed with further development.
    • Some features just printout the result for testing purposes.

Future Work

  • Integrate CI to publish the library.
  • Enhance error handling mechanisms.
  • Implement additional features and functionality.
  • Add test code after we decide on which features to provide

Issue

#615

@seonWKim
Copy link
Contributor Author

seonWKim commented Jan 4, 2025

the force push made some mess 🙏

}
}

private void printElementType(Object element) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for debugging purposes, we can remove later stage on development

import org.github.tursodatabase.limbo.Limbo;

public class Main {
public static void main(String[] args) throws Exception {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for debugging purpose, let's remove it at later stage of development

@penberg
Copy link
Collaborator

penberg commented Jan 4, 2025

Hey @seonWKim, awesome, thanks for doing this! I will review this and happy to merge as a nice incremental step! However, I think the path for Java ecosystem is to turn this into a JDBC driver, similar to https://github.com/xerial/sqlite-jdbc.

@seonWKim
Copy link
Contributor Author

seonWKim commented Jan 4, 2025

@penberg Thanks for the review. I should look into that project. 🙏

I think this PR can be a wrapper for native functions supported by limbo as sqlite-jdbc did.

After deciding on which native functions to support(maybe similar to sqlite-jdbc), we can separate the java bindings to another repository(a long future work maybe). Currently I've added features by referring to python bindings.

@penberg penberg changed the title Add support for java bindings Add support for Java bindings Jan 5, 2025
@penberg penberg closed this in fdbf62d Jan 5, 2025
@penberg
Copy link
Collaborator

penberg commented Jan 5, 2025

Hey @seonWKim, no, I think it's good that the bindings are in the same tree because it allows more people to work on it!

The comment about JDBC is mostly about what the interface of the Java bindings should be. You almost certainly want to expose things as JDBC because that's what the rest of the ecosystem uses. The sqlite-jdbc project was just an example of how people do that in the SQLite ecosystem.

@penberg
Copy link
Collaborator

penberg commented Jan 5, 2025

Merged, by manually folding the commits into one.

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 this pull request may close these issues.

2 participants