[ckan-dev] CKAN on top of Existing DBs

Ross Jones ross at servercode.co.uk
Thu Jul 17 18:14:43 UTC 2014


As long as the database is accessible from the CKAN instance, and ideally *not* accessible via the Internet, then this seems feasible although I suspect it would be safer to use for an internal system than exposed to the internet.

I haven’t seen a plugin that does this, but it sounds feasible that it could be developed (http://docs.ckan.org/en/latest/extensions/tutorial.html#creating-a-new-extension). You’d need a custom resource schema (docs.ckan.org/en/latest/extensions/adding-custom-fields.html#adding-custom-fields-to-resources), and a set of logic functions(docs.ckan.org/en/latest/extensions/plugin-interfaces.html#ckan.plugins.interfaces.IActions), possibly a resource preview (http://docs.ckan.org/en/latest/extensions/plugin-interfaces.html#ckan.plugins.interfaces.IResourcePreview)  and a handful of templates (http://docs.ckan.org/en/latest/theming/templates.html).

Ross


On 17 Jul 2014, at 17:56, Rimar, Steve <srimar at qualcomm.com> wrote:

> Ross – the way I would envision it is when adding a dataset there would be a 3rd option which would be Existing Database. You would then enter the database connection info depending on the type of DB similar to how database query tools work. Once the connection is entered you would have the option to browse and select tables or schemas or enter SQL.
> 
> For the user who is looking at the dataset in CKAN they would be able to preview a snapshot of the data similar to how the preview works for CSV files.
> 
> The data would not be imported into CKAN as this would defeat the purpose. CKAN would just store the connection info and the tables/schemas or custom SQL. 
> 
> Do you know if this would be possible to develop? Has anyone been creating plug-in for this?
> 
> -Steve
> 
> From: Ross Jones <ross at servercode.co.uk>
> Reply-To: CKAN Development Discussions <ckan-dev at lists.okfn.org>
> Date: Thursday, July 17, 2014 at 2:58 AM
> To: CKAN Development Discussions <ckan-dev at lists.okfn.org>
> Subject: Re: [ckan-dev] CKAN on top of Existing DBs
> 
> It’d be really useful to have some user stories for this I think. For instance, what does the user provide instead of a file or URL? Is it an ODBC connection string and a query? How would it safely handle authentication with the DB?
> 
> Perhaps it would be better for the user to provide an OData endpoint url when creating a resource?  Or a separate simple flask app that does the DB->CSV conversion for display (and perhaps allows you to specify a query in the preview?).
> 
> At the moment, although I understand the high level request, I’m not really sure how you envision it working.  I can’t see why it can’t be built though (other than not being very clear) particularly if you can provide the data via a URL.
> 
> Ross
> 
> 
> On 16 Jul 2014, at 19:54, Rimar, Steve <srimar at qualcomm.com> wrote:
> 
>> Hi - we're trying to use CKAN for our organization’s data registry and were wondering how we would use this on top of existing datasets that are in databases such as Oracle or SQL Server? When you add a dataset in CKAN you have 3 options: File, Link or API. Looks like there's an option missing for Database or JDBC/ODBC? Is this available as an add-on or plug-in? Can we build this out ourselves if not?
>> 
>> Thanks,
>> Steve
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> 
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140717/ad7eb3b7/attachment-0003.html>


More information about the ckan-dev mailing list