I need to create some cross-platform tools that will be interfacing with the NOSQL database "mongodb". Since I'm doing this of my own accord, I figured why not have a good time doing it, so naturally my thoughts turned to PB
There is a mongodb driver for C described here http://api.mongodb.org/c/current/index.html -- It seems that the C language driver is very complete.
My questions for you good people:
1. Will it be easy interfacing using the C language driver from PB? By easy, I mean easier than if there wasn't such a well-documented and current C driver?
2. Is it possible to interface to the C language driver on multiple platforms (Windows, OSX, and Linux)?
2. Is it possible to attempt this using the PB trial, and then take the plunge if it looks like it will work out?
I know (because I lurk here for years now) that people are always asking about interfacing to some external library, but for some reason my searching here didn't turn up a similar case. But I apologize if this is a worn out FAQ.
Thanks for any advice!
Interfacing with mongodb
Re: Interfacing with mongodb
Actually, looking at that C library, I think that I misunderstood the task at hand here. Since the only thing available is C source code, wouldn't that mean that the only way to get PB to interface with mongodb the same way would be to re-write the C code in PB?
Re: Interfacing with mongodb
If you compile the C driver source to .obj/.lib or .dll+.lib, you should be able to use it with PureBasic.los wrote:Actually, looking at that C library, I think that I misunderstood the task at hand here. Since the only thing available is C source code, wouldn't that mean that the only way to get PB to interface with mongodb the same way would be to re-write the C code in PB?
You would just have to write ImportC function declarations for the .lib functions.
Re: Interfacing with mongodb
Ah I see.. thanks! I'm going to give it a try
Re: Interfacing with mongodb
someone can post a code example with the import and use in PB of C API mongodb functions?
thanks in advance!
thanks in advance!
Re: Interfacing with mongodb
You could consider accessing through an ODBC driver.
https://www.mongodb.com/blog/post/odbc- ... telligence
https://www.mongodb.com/blog/post/odbc- ... telligence