Database Reference
In-Depth Information
Creating the PBMS system tables
If all the requirements have been met, we can go to the marc_book database in the
Operations subpage. We should see a BLOB Repository dialog, a Status: Disabled
message, and an Enable button. We now have to click Enable to create the PBMS
system tables inside this database. There are two system tables required by PBMS
( pbms_repository and pbms_reference ), and another one ( pbms_custom_content_
type ) for phpMyadmin's internal needs.
After creation, we'll see Status: Enabled on the same page, but not the newly created
system tables. Usually, these tables are kept invisible from within phpMyAdmin
because a user should not play with them directly.
We also see a Disable button. Clicking on it shows a warning:
You are about to DISABLE a BLOB Repository! Are you sure you want to
disable all BLOB references for database marc_book?
Confirming this warning message would make PBMS forget all the BLOB references
in this database, which would eventually delete all BLOB streaming data previously
referenced from this database (if no other reference exists for it from another database).
Table preparation
For this exercise, we'll use the book.cover_photo column, and LONGBLOB to hold
the BLOB reference (remember that the stream data itself is located in the BLOB
repository, and the LONGBLOB column is only there to contain the reference). We
ensure that the book table is under the PBXT storage engine, and if it's not the case,
we just need to go to Operations for this table and change the engine, as explained
in Chapter 10.
Using a LONGBLOB for BLOB reference is currently a PBXT requirement.
Uploading to BLOB repository
We are finally ready to try our first upload to the repository. In the book table, we
access the Insert panel (or we edit an existing row). Note the new Upload to BLOB
repository option in the dialog for the cover_photo column:
 
Search WWH ::




Custom Search