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

Question: MongoDB Bindings #9

Open
AngelMunoz opened this issue Jul 28, 2021 · 1 comment
Open

Question: MongoDB Bindings #9

AngelMunoz opened this issue Jul 28, 2021 · 1 comment

Comments

@AngelMunoz
Copy link

Inspired by the Glutinum bindings for Express I decided allow a small mongo commands DSL library I made a few months back to run on Fable I added a sample here thinking that there might be node projects that use mongo and can't simply be migrated to .NET/Fable just due the database

the missing glue (bad pun I know) here is the mongodb driver bindings as you can see in
sample.js you don't actually need to bind the whole library just a MongoClient with a few extra types might be needed

How do binding requests work and what do I actually need to do in case this looks do'able?

@MangelMaxime
Copy link
Collaborator

the missing glue (bad pun I know)

Then I am the culpit of the bad pun as the project name come from it 🤣 https://github.com/glutinum-org/Glutinum#why-this-name

The goal of Glutinum is to explore how we can improves the bindings and provides "quality" / tested bindings for JavaScript libraries.

Binding only the MongoClient doesn't exactly fit into this goal but it is true that we can't directly have a binding 100% done. For example, even if Express has 424 not everything is tested yet.

With that being said, I think the most important point of Glutinum is to have tests written for the "supported" APIs. The reason being that it will help us make it safer to improve the bindings and also detect breaking changes, API regression.

If you are ok to write some of the bindings and tests that goes with it.

Here is how you can add a new glue to the project:

If my script works has expected 😇

  1. npm install

  2. Invoke the build.js script with the init arguments

    https://github.com/glutinum-org/Glutinum#how-to-use-this-repository

    For example, build.js init

  3. Follow the instructions

  4. After adding the glue to the projects list in the 'build.js' file, you should be able to run build.js test --project projectName to run the tests against that project.

In order, to have a Mongo instance to run the tests against, we can take inspiration from how they do it in mongo repo. Manually starting a server instance.

https://github.com/mongodb/node-mongodb-native/blob/4.0/CONTRIBUTING.md#running-the-tests

In the future, I am planning to have the glues separated in different repo so we can have docker file or custom CI available for them but as everything is still Work In Progress right now, it is easier to have a mono repo.

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

No branches or pull requests

2 participants