Read and query rekordbox OneLibrary (exportLibrary.db) SQLCipher databases
from Pioneer DJ / AlphaTheta devices. Useful for inspecting USB exports, CDJ
SD cards, and the OneLibrary databases used by modern rekordbox versions.
npm install onelibrary-connectThis package depends on better-sqlite3-multiple-ciphers for SQLCipher
decryption. It will be built as a native module on install.
import { OneLibraryAdapter } from 'onelibrary-connect';
const db = new OneLibraryAdapter('/path/to/exportLibrary.db');
// Look up a single track
const track = db.findTrack(1);
console.log(`${track.artist?.name} - ${track.title}`);
// Iterate every track
for (const t of db.findAllTracks()) {
console.log(t.id, t.title, t.tempo, t.key?.name);
}
// Walk the playlist tree
const { folders, playlists, trackEntries } = db.findPlaylist();
for (const playlist of playlists) {
const trackIds = db.findPlaylistContents(playlist.id);
console.log(`${playlist.name}: ${trackIds.length} tracks`);
}
// History sessions (one per DJ set recorded on the device)
for (const session of db.findHistorySessions()) {
const trackIds = db.findHistoryContents(session.id);
console.log(`${session.name}: ${trackIds.length} tracks`);
}
db.close();Open a OneLibrary database. The file is opened read-only and decrypted with the built-in SQLCipher key used by Pioneer DJ devices.
findTrack(id)— Find a track bycontent_id, with joined artist, album, genre, key, color, label, artwork, remixer, original artist, and composerfindAllTracks()— Return every track in the library
findCues(trackId)— Return all cue points, loops, hot cues, and hot loops for a track as a unifiedCueAndLoop[]
findPlaylist(playlistId?)— Return{ folders, playlists, trackEntries }for a given playlist ID, or the root if omittedfindPlaylistById(id)— Fetch a single playlist rowfindPlaylistContents(id)— Track IDs in order for a playlist
findMyTags(parentId?)— Return{ folders, tags }for MyTagsfindMyTagById(id)/findMyTagContents(id)/findMyTagsForTrack(trackId)
findHistorySessions()— All history sessions on the devicefindHistoryContents(historyId)— Track IDs in a session
findHotCueBankLists()— All hot cue bank listsfindHotCueBankListCues(bankListId)— Cue IDs in a bank list
findMenuItems()— All browse menu itemsfindVisibleCategories()— Categories the user has enabledfindVisibleSortOptions()— Sort options the user has enabled
findArtist(id),findAlbum(id),findGenre(id),findKey(id),findColor(id),findLabel(id),findArtwork(id)
getProperty()— Returns{ deviceName, dbVersion, numberOfContents, createdDate, backgroundColorType }
openOneLibraryDb(path)— Open the SQLCipher database directly without the adapter wrappergetEncryptionKey()— Returns the SQLCipher key
MIT