https://github.com/lyrasis/collectionspace-sql
Notes on and examples of SQL for working with CollectionSpace data
https://github.com/lyrasis/collectionspace-sql
collectionspace postgresql sql
Last synced: 5 months ago
JSON representation
Notes on and examples of SQL for working with CollectionSpace data
- Host: GitHub
- URL: https://github.com/lyrasis/collectionspace-sql
- Owner: lyrasis
- Created: 2021-06-08T18:08:08.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-08-04T15:09:21.000Z (11 months ago)
- Last Synced: 2025-08-04T19:09:31.979Z (11 months ago)
- Topics: collectionspace, postgresql, sql
- Homepage:
- Size: 80.1 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
:toc:
:toc-placement!:
:toclevels: 4
= CollectionSpace SQL
A place to record tips for working with CollectionSpace data directly in the PostgreSql database
toc::[]
== Conventions
Client-identifying info has been removed from SQL examples and replaced with the following patterns:
`{INSTANCEDOMAIN}` replaces values like `core.collectionspace.org` or `collectionspace.clientdomain.org` in refname values or elsewhere
[source,sql]
----
CAST(E'urn:cspace:{INSTANCEDOMAIN}:vocabularies:name(publishto):item:name(all)\'All\'' AS text) AS item
----
== Contents
* https://github.com/lyrasis/collectionspace-sql/blob/main/getting_into_database.adoc[Getting into the databases]
* https://github.com/lyrasis/collectionspace-sql/blob/main/common_patterns.adoc[Common patterns/snippets] - excluding deleted records, how to find data for a given record from the application UI, etc
* https://github.com/lyrasis/collectionspace-sql/blob/main/functions.adoc[Functions] - reusable bits
* https://github.com/lyrasis/collectionspace-sql/blob/main/data_projects.adoc[Data projects] - queries to support actual work
== Other resources
* Nuxeo database documentation: https://doc.nuxeo.com/nxdoc/internal-vcs-model/[Internal VCS Model] -- https://doc.nuxeo.com/nxdoc/vcs-tables/[VCS tables]
* Some example JasperReports have embedded PGSQL queries to crib from:
** https://github.com/collectionspace/services/tree/master/services/report/3rdparty/jasper-cs-report/src/main/resources[standard reports]
** https://github.com/lyrasis/cspace-deployer/tree/master/docker/dts/production/mcgill/reports[mcgill]
** https://github.com/lyrasis/cspace-deployer/tree/master/docker/dts/production/ohc/reports[ohc]