-
Notifications
You must be signed in to change notification settings - Fork 4
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
Database handling internal to Procon #2
Comments
… existing Procon.Database to two seperate dll's. One to handle connections (importing all the drivers) and one to handle serialization (so plugins and their seperate appdomains only need to load a light weight dll)
According to these requirements, I think we should implement a whole storage abstraction layer. So the admin can decide weather to store data in mysql, nosql, filesystem, sql, oracle or whatever. We should also think about migration paths, changes to a data model and so on. |
Migration handling will be included, but will need to be initiated by a plugin to ensure its tables are updated. Procon will setup a migration collection itself when a database is opened, but otherwise all alterations will be passed from the plugin like other queries. Migration will support version, up() and down(). Probably indexed by the plugin Guid. More than likely a bunch of other meta data for kicks. Collections, via standardized naming convention, will be restricted to a plugin, a plugin on a specific connection or global to all connections/plugins. I'm not busting a gut on other storage options beyond MySql, MongoDb and SqlLite. I've had a couple people ask for MsSql about a year ago, otherwise most hosts just run MySql. I'm the one pushing Mongo on people cause I think it's neat :) Procon itself only requires a migration model, otherwise it shouldn't know of anything in the database. With this in mind something can easily be thrown together, much like a plugin would. The entire database support is simply so plugins have something to use and we can lock the the plugin appdomain security down a little bit. Results of queries will more than likely be passed back to the plugin/daemon client in json. Allows for queries to be initiated over the daemon with results. Since we're using the Newtonsoft.Json plugin developers will be able to easily deserialize this back to an array of a certain type of object. |
Still requires index support and additional type support.
Still require primary/unique for mysql and full mongo support
Added tests as well, since the support was included in the last commit
Required a fair bit of refacoring to handle child methods on the query. Since this is essentially a save()-Fail-Update it makes sense to just build the two queries separately then merge them together.
Also renamed the "IQuery" object to allow for results to be easily combined with existing logic
Though this does not support multiple indexes or unique/primary indexes just yet. It may require some refactoring of the entire index build to allow for this.
With that minor amount of refactoring mentioned in the last commit.
This branch has been merged in. Procon.Database and Procon.Database.Serialization are functionally complete. Refactoring and changes will undoubtedly occur. I need this in the main branch to begin adding functionality to Procon.Core.Database namespace so plugin unit testing of database functionality can begin easily. |
Database connections and querying should be completely handled by Procon, removing control from plugins to establish and directly query a database. This should ease user setup and tighten the sandbox on plugin actions.
Benefits
Requirements
Notes
Three people have tried to implement something like this in Procon. Some import every library written in .NET to get something sort of working. Others are very specific on MySQL functionality. Keep. It. Simple.
The text was updated successfully, but these errors were encountered: