Serials: utility db functions for troubleshooting, data munging

Bug #1229375 reported by Lebbeous Fogle-Weekley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Triaged
Wishlist
Unassigned

Bug Description

Here's a branch containing a few stored procedures for troubleshooting serials that have come in handy for me.

I don't know why we ever decided to make columns in the serials schema that are meant to contain a MARC field encoded as a JSON array, nor whether there's a real name or formal specification for that (but I doubt it).

These functions:

FUNCTION evergreen.jsonmarc_add_subfield ( jsonmarc TEXT, subfield CHAR, value TEXT ) RETURNS TEXT
FUNCTION evergreen.jsonmarc_update_subfield ( jsonmarc TEXT, subfield CHAR, value TEXT ) RETURNS TEXT
FUNCTION evergreen.jsonmarc_sort_subfields ( jsonmarc TEXT ) RETURNS TEXT
FUNCTION evergreen.jsonmarc_get_subfield ( jsonmarc TEXT, subfield CHAR ) RETURNS TEXT
FUNCTION evergreen.jsonmarc_get_subfields ( jsonmarc TEXT, subfield CHAR ) RETURNS TEXT[]
FUNCTION evergreen.jsonmarc_delete_subfields ( jsonmarc TEXT, subfield CHAR ) RETURNS TEXT

all take a piece of this "jsonmarc" as their first argument. Then they manipulate it and returned an altered piece of jsonmarc, or they look something up from it and return that.

This branch may need polish before inclusion in Evergreen, but I've developed these to help me and there's no reason everybody needs to reinvent this wheel.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/collab/senator/jsonmarc

Tags: serials json
Revision history for this message
Ben Shum (bshum) wrote :

Might be helpful someday.

Changed in evergreen:
status: New → Triaged
assignee: nobody → Dan Wells (dbw2)
Changed in evergreen:
assignee: Dan Wells (dbw2) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.