import { AdapterPool } from './types' ; const loadSnapshot = async ( { snapshotsTableName , query , escapeId , escape } , snapshotKey ) : Promise < string | null > => { if ( snapshotKey == null || snapshotKey . constructor !== String ) { throw new Error ( 'Snapshot key must be a string' ) ; } const snapshotsTableNameAsId = escapeId ( snapshotsTableName ) ; const [ rows ] = await query ( `SELECT \`SnapshotContent\` FROM ${ snapshotsTableNameAsId }
   WHERE \`SnapshotKey\`= ${ escape ( snapshotKey ) } ` ) ; return rows . length > 0 ? rows [ 0 ] . SnapshotContent . toString ( ) : null ; } ; export default loadSnapshot ;