{"id":41319614,"url":"https://github.com/lyrasis/collectionspace-sql","last_synced_at":"2026-01-23T05:49:29.006Z","repository":{"id":70825729,"uuid":"375102474","full_name":"lyrasis/collectionspace-sql","owner":"lyrasis","description":"Notes on and examples of SQL for working with CollectionSpace data","archived":false,"fork":false,"pushed_at":"2025-08-04T15:09:21.000Z","size":82,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-08-04T19:09:31.979Z","etag":null,"topics":["collectionspace","postgresql","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lyrasis.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-06-08T18:08:08.000Z","updated_at":"2025-08-04T15:06:07.000Z","dependencies_parsed_at":"2024-04-29T18:25:40.878Z","dependency_job_id":"5b378f77-f4d0-4380-9341-02f37bbbe962","html_url":"https://github.com/lyrasis/collectionspace-sql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lyrasis/collectionspace-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyrasis%2Fcollectionspace-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyrasis%2Fcollectionspace-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyrasis%2Fcollectionspace-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyrasis%2Fcollectionspace-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lyrasis","download_url":"https://codeload.github.com/lyrasis/collectionspace-sql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyrasis%2Fcollectionspace-sql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28681345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collectionspace","postgresql","sql"],"created_at":"2026-01-23T05:49:28.425Z","updated_at":"2026-01-23T05:49:28.990Z","avatar_url":"https://github.com/lyrasis.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":":toc:\n:toc-placement!:\n:toclevels: 4\n\n= CollectionSpace SQL\n\nA place to record tips for working with CollectionSpace data directly in the PostgreSql database\n\ntoc::[]\n\n== Conventions\n\nClient-identifying info has been removed from SQL examples and replaced with the following patterns:\n\n`{INSTANCEDOMAIN}` replaces values like `core.collectionspace.org` or `collectionspace.clientdomain.org` in refname values or elsewhere\n\n[source,sql]\n----\nCAST(E'urn:cspace:{INSTANCEDOMAIN}:vocabularies:name(publishto):item:name(all)\\'All\\'' AS text) AS item\n----\n\n== Contents\n* https://github.com/lyrasis/collectionspace-sql/blob/main/getting_into_database.adoc[Getting into the databases]\n* 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\n* https://github.com/lyrasis/collectionspace-sql/blob/main/functions.adoc[Functions] - reusable bits\n* https://github.com/lyrasis/collectionspace-sql/blob/main/data_projects.adoc[Data projects] - queries to support actual work\n\n== Other resources\n* Nuxeo database documentation: https://doc.nuxeo.com/nxdoc/internal-vcs-model/[Internal VCS Model] --  https://doc.nuxeo.com/nxdoc/vcs-tables/[VCS tables]\n* Some example JasperReports have embedded PGSQL queries to crib from:\n** https://github.com/collectionspace/services/tree/master/services/report/3rdparty/jasper-cs-report/src/main/resources[standard reports]\n** https://github.com/lyrasis/cspace-deployer/tree/master/docker/dts/production/mcgill/reports[mcgill]\n** https://github.com/lyrasis/cspace-deployer/tree/master/docker/dts/production/ohc/reports[ohc]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyrasis%2Fcollectionspace-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flyrasis%2Fcollectionspace-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyrasis%2Fcollectionspace-sql/lists"}