<commit_before>namespace ZincDB {
	export namespace DB {
		const RemoteEntriesStoreName = "RemoteEntries";
		const LocalEntriesStoreName = "LocalEntries";
		const GlobalMetadataStoreName = "GlobalMetadata";
		const ObjectStoreNames = [GlobalMetadataStoreName, LocalEntriesStoreName, RemoteEntriesStoreName];

		export class LocalDBOperations {
			private db: StorageAdapter;
			protected readonly nodeLookup: NodeLookup = new NodeLookup();

			async open(name: string, options: LocalDBOptions) {
				const localDBIdentifier = `ZincDB_${name}`;

				switch (options.storageMedium) {
					case "InMemory":
						this.db = new InMemoryAdapter(localDBIdentifier);
						break;

					case "IndexedDB":
						if (!IndexedDBAdapter.isAvailable)
							throw new Error("IndexedDB is not available at the current context.");

						this.db = new IndexedDBAdapter(localDBIdentifier);
						break;

					case "WebSQL":
						if (!WebSQLAdapter.isAvailable)
							throw new Error("WebSQL is not available at the current context.");

						this.db = new WebSQLAdapter(localDBIdentifier);
						break;

					case "SQLite":
						if (!NodeSQLiteAdapter.isAvailable)
							throw new Error("SQLite is not available at the current context.");

						this.db = new NodeSQLiteAdapter(localDBIdentifier, options.storagePath || "");
						break;

					case "LevelDB":
						if (!LevelUpAdapter.isAvailable)
							throw new Error("LevelDB is not available at the current context.");

						this.db = new LevelUpAdapter(localDBIdentifier, options.storagePath || "");
						break;

					case "OnDisk":
						if (IndexedDBAdapter.isAvailable)
							this.db = new IndexedDBAdapter(localDBIdentifier);
						else if (WebSQLAdapter.isAvailable)
							this.db = new WebSQLAdapter(localDBIdentifier);
						else if (NodeSQLiteAdapter.isAvailable)
							this.db = new NodeSQLiteAdapter(localDBIdentifier, options.storagePath || "");
						else if (LevelUpAdapter.isAvailable)
							this.db = new LevelUpAdapter(localDBIdentifier, options.storagePath || "");
							
						else
							this.db = new InMemoryAdapter(localDBIdentifier);
						break;

					default:
						throw new Error("Invalid storage medium specified.")
				}<commit_msg>Reordered "OnDisk" selection fallback order<commit_after>namespace ZincDB {
	export namespace DB {
		const RemoteEntriesStoreName = "RemoteEntries";
		const LocalEntriesStoreName = "LocalEntries";
		const GlobalMetadataStoreName = "GlobalMetadata";
		const ObjectStoreNames = [GlobalMetadataStoreName, LocalEntriesStoreName, RemoteEntriesStoreName];

		export class LocalDBOperations {
			private db: StorageAdapter;
			protected readonly nodeLookup: NodeLookup = new NodeLookup();

			async open(name: string, options: LocalDBOptions) {
				const localDBIdentifier = `ZincDB_${name}`;

				switch (options.storageMedium) {
					case "InMemory":
						this.db = new InMemoryAdapter(localDBIdentifier);
						break;

					case "IndexedDB":
						if (!IndexedDBAdapter.isAvailable)
							throw new Error("IndexedDB is not available at the current context.");

						this.db = new IndexedDBAdapter(localDBIdentifier);
						break;

					case "WebSQL":
						if (!WebSQLAdapter.isAvailable)
							throw new Error("WebSQL is not available at the current context.");

						this.db = new WebSQLAdapter(localDBIdentifier);
						break;

					case "SQLite":
						if (!NodeSQLiteAdapter.isAvailable)
							throw new Error("SQLite is not available at the current context.");

						this.db = new NodeSQLiteAdapter(localDBIdentifier, options.storagePath || "");
						break;

					case "LevelDB":
						if (!LevelUpAdapter.isAvailable)
							throw new Error("LevelDB is not available at the current context.");

						this.db = new LevelUpAdapter(localDBIdentifier, options.storagePath || "");
						break;

					case "OnDisk":
						if (LevelUpAdapter.isAvailable)
							this.db = new LevelUpAdapter(localDBIdentifier, options.storagePath || "");					
						else if (IndexedDBAdapter.isAvailable)
							this.db = new IndexedDBAdapter(localDBIdentifier);
						else if (NodeSQLiteAdapter.isAvailable)
							this.db = new NodeSQLiteAdapter(localDBIdentifier, options.storagePath || "");
						else if (WebSQLAdapter.isAvailable)
							this.db = new WebSQLAdapter(localDBIdentifier);
						else
							this.db = new InMemoryAdapter(localDBIdentifier);
						break;

					default:
						throw new Error("Invalid storage medium specified.")
				}
{'fraction_non_alphanumeric': 0.09252189535144846, 'fraction_numerical': 0.0, 'mean_word_length': 3.498989898989899, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4922765', 'n_tokens_mistral': 1617, 'n_tokens_neox': 1182, 'n_words': 324}