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

How to use with TypeScript #131

Open
taylor009 opened this issue Jun 16, 2020 · 8 comments
Open

How to use with TypeScript #131

taylor009 opened this issue Jun 16, 2020 · 8 comments

Comments

@taylor009
Copy link

@adam-cowley I was wondering if there were some typescript examples or if neode can be used with typescript yet? If there isn't any I could help out on that.

@dcsan
Copy link

dcsan commented Dec 27, 2020

I also had this question. Some things would probably have to be ignored like these dynamic requires:

const neode = require('neode')
    .fromEnv()
    .with({
        Movie: require('./models/Movie'),

full model validation would be great, but pretty hard.
prisma does this well.
You could also look at typegoose which tries to infer types with Mongoose.

@adam-cowley
Copy link
Owner

adam-cowley commented Dec 28, 2020

Yeah this raises some interesting questions on how this library would be used or could be improved to be more class/decorator oriented like prisma/typegoose. I'm trying to work out whether this is a shift in node/typescript development or whether it should become a separate library. I'd love to hear everyone's thoughts?

@taylor009
Copy link
Author

@adam-cowley I saw your comment I made inside the TypeORM repo about adding the support for neo4j. Might be challenging to replicating fully but I think as the node community shifts more into typescript having the class/decorator demand will increase. I'm not sure how difficult it would be to convert the existing library.

But if we need to split it out I'm willing to dedicate some time to it if needed.

@adam-cowley
Copy link
Owner

I've started experimenting over here - it's basic at the moment but there are a few lines in the README and a couple of tests. It's quite far removed from neode as it stands at the moment so I may have to think how they might fit together.

https://github.com/adam-cowley/neode-ogm

I'm torn between wanting things to be properly coded (objects, etc) or whether I'd just want something that just works with minimal code/effort. But then if we're creating model files, it's only a few lines more to turn it into a class with annotations.

@dcsan
Copy link

dcsan commented Jan 1, 2021

do you know this driver? how does it compare?
https://drivine.org/

@adam-cowley
Copy link
Owner

Drivine looks handy for transaction management but it still requires that you write your own queries - something that I'd personally like to avoid if possible by defining the model meta data and let the library take care of writing the queries. Jasper makes some good points under the Object Mapping: header on the homepage.

@adam-cowley
Copy link
Owner

adam-cowley commented Jan 14, 2021

I've put together a basic example with the typescript repo at https://github.com/adam-cowley/neode-ogm-test

@adam-cowley
Copy link
Owner

All feedback welcome...

adam-cowley/neode-ogm-test#3

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

3 participants