-
Notifications
You must be signed in to change notification settings - Fork 118
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
PostgreSQL tables like Mongo collections #114
Comments
Hi @ArturFormella, What you suggest is quite interesting and ToroDB Server 0.40 supports it partially. There is a command that allow to execute any readonly sql sentence. The result set returned by postgres is then translated to a MongoDB Cursor. There are a couple of issues with that approach:
On the other hand, this is not exactly as "regular PostgreSQL tables as collections" because you have to query them using SQL queries. You cannot access non-torodb tables with the MongoDB syntax. We would like to do that, but it is quite difficult (specially if you want to build hierarchical json objects with several tables). There is also a unorthodox and hackish way to do what you want. You can "hack" your tables to look like ToroDB tables and add to the ToroDB metatables, then ToroDB should be able to execute read only queries against them. If you don't want to modify your tables, it should work with views. |
Hello! I was thinking of Torodb as gateway to Postgres database with all advantages of MongoDB query language. I will try a hackish way first :) Is this document current? |
Nope, it is not! We have to update it or remove it until we can do it because it can be confusing. The new storage engine used by ToroDB Server follows the ToroDB Stampede conventions (you can found them here). Since some month ago we have been focused on ToroDB Stampede (the solution that replicates from a MongoDB replica set but does not offer a MongoDB interface to talk with the data) and ToroDB Server has fallen behind. Tomorrow or early next week we will have a more useful version of ToroDB Server on the devel branch. I recommend you to wait until then to start to start your hacking season. |
Hi @ArturFormella , I have just accept a PR on the devel branch that fixed a couple of bugs on ToroDB Server. Feel free to test it if you want. I am looking forward to hear from your experience. |
Is it possible to expose regular PostgreSQL tables as collections? Even read only.
The text was updated successfully, but these errors were encountered: