mashingan / anonimongo

Another Nim pure Mongo DB driver
MIT License
43 stars 5 forks source link

Makes it compile with nim 2.1.99 #fixes #36 #37

Open jmgomez opened 1 month ago

mashingan commented 1 month ago

Tried running this with nimble test got this message:

~/anonimongo/tests/utils_test.nim(78, 34) template/generic instantiation of `newMongo` from here
~/anonimongo/src/anonimongo/core/types.nim(306, 17) Error: ambiguous identifier: 'Uri' -- use one of the following:
  uri.Uri: Uri
  QKind.URI: QKind

I think it's because the uri variable defined above it make it ambiguous to use it as uri.Uri.

jmgomez commented 1 month ago

Tried running this with nimble test got this message:

~/anonimongo/tests/utils_test.nim(78, 34) template/generic instantiation of `newMongo` from here
~/anonimongo/src/anonimongo/core/types.nim(306, 17) Error: ambiguous identifier: 'Uri' -- use one of the following:
  uri.Uri: Uri
  QKind.URI: QKind

I think it's because the uri variable defined above it make it ambiguous to use it as uri.Uri.

Yes. Thats why I moved it to the top in one of the changes. I missed that one because I couldnt get the test to work in local and it seems that the error you are seeing didnt trigger by my use case

mashingan commented 1 month ago

It's solved by adjusting to uri.Uri so it won't be ambiguous anymore.

Also, at very least you should run nim r tests/test_bson_test.nim to check if it's breaking or not due to version upgrade. This won't boot up mongod child process and simply tests for BSON module.

In case you want to test for most of db commands, you can set your config.nims like in this github action setting. As long the standalone test is completed, whether success or failed, it will kill the booted mongod child process.

samsamros commented 1 month ago

I will test soon, what is the status, was the Uri.uri adjusted? did it work?

mashingan commented 1 month ago

No, not yet. The regressions are more than that.