"""SQL queries for direct_delivery.""" # insert VO as encoding_queue item INSERT_ENCODING_QUEUE = """ INSERT IGNORE INTO encoding_queue (encoding_order_id, priority, encoding_order_type, encoder_id, meta_update) VALUES (:order_id, :priority, :order_type, :encoder_id, :meta_update); """ # get encoding_queue_id by VO id and VO type SELECT_ENCODING_QUEUE_ID = """ SELECT encoding_queue_id FROM encoding_queue WHERE encoding_order_id = :order_id AND encoding_order_type = :order_type LIMIT 1; """ # select all details for some specific encoding queue SELECT_ENCODING_QUEUE_DETAILS = """ SELECT upc, dms_master_master_id FROM direct_delivery.encoding_queue_detail WHERE encoding_queue_id = :encoding_queue_id; """ # insert encoding_queue_detail items INSERT_ENCODING_QUEUE_DETAILS = """ INSERT INTO encoding_queue_detail (encoding_queue_id, upc, dms_master_master_id) VALUES (:encoding_queue_id, :upc, :dms_master_master_id); """