Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
16e3c61
added .jj to .gitignore
CD-Z Feb 17, 2026
f246b3b
chore: Add drizzle-orm and drizzle-kit dependencies to package.json a…
Dec 19, 2025
449efb6
update debs
CD-Z Dec 21, 2025
15e3c2d
Edit configs
CD-Z Dec 23, 2025
03b2930
create drizzle schema
CD-Z Dec 23, 2025
470b2af
generate drizzle migration
CD-Z Dec 23, 2025
c2e9520
db manager stuff
CD-Z Dec 23, 2025
af4fe93
Delete unused files
CD-Z Dec 25, 2025
192c0fe
Update DB Manager
CD-Z Dec 25, 2025
fc9e04c
Rework CategoryQueries and related
CD-Z Dec 26, 2025
2e8431f
rewrite chapterQueries
CD-Z Dec 26, 2025
ead59dc
Type safety for chapter order and filter
CD-Z Dec 28, 2025
4336653
Better filter handling
CD-Z Dec 29, 2025
4c1d3d8
added queue
CD-Z Dec 29, 2025
3251fd8
added back database triggers
CD-Z Dec 29, 2025
b88306d
Refactor HistoryQueries and LibraryQueries
CD-Z Dec 29, 2025
d098713
fix type issues
CD-Z Dec 29, 2025
e9b9ae4
refactor StatsQueries
CD-Z Dec 29, 2025
ef665e7
refactor NovelQueries
CD-Z Dec 29, 2025
39c7c16
renamed schemas
CD-Z Dec 30, 2025
b941734
refactor more db calls
CD-Z Dec 30, 2025
7b1e6bb
refactor libraryUpdateQueries
CD-Z Dec 30, 2025
44b4cf6
removed deprecated code
CD-Z Dec 30, 2025
549e6ee
added extracted queries
CD-Z Dec 30, 2025
3bc98d6
fix updates screen issue
CD-Z Dec 30, 2025
3ff4363
change to op-sqlite
CD-Z Dec 30, 2025
48f4ffa
Update manager.ts
CD-Z Jan 2, 2026
98d41a5
Update RepositoryQueries
CD-Z Jan 2, 2026
ec86292
update packages
CD-Z Jan 2, 2026
663e537
Update NovelQueries
CD-Z Jan 2, 2026
afad83a
Update CategoryQueries.ts
CD-Z Jan 2, 2026
d3a7ec4
db testing environment v1 (AI)
CD-Z Jan 2, 2026
2c8a3c3
Refactor App component to use Suspense for loading state and update d…
CD-Z Jan 4, 2026
399698c
updated tests
CD-Z Jan 4, 2026
9eec7e3
change db location to default expo-sqlite location
CD-Z Jan 4, 2026
ac0c90c
fix async/sync bugs
Feb 2, 2026
f6e8c38
resolve rebase problems
Feb 2, 2026
654c561
Added tests for db creation + migration
Feb 3, 2026
099df8b
update drizzle
Feb 3, 2026
5737346
add missing journals to migrations.js
Feb 3, 2026
1d235cb
wrap testDbManager in Proxy to be async
Feb 3, 2026
46aba3d
add db initialization test
Feb 3, 2026
e4db64a
fix lint errors
Feb 3, 2026
af21601
improved dbManager.batch function
Feb 7, 2026
59d5af4
remove unused file
CD-Z Feb 17, 2026
9e71e4b
fix rebase conflicts
CD-Z Feb 17, 2026
3003628
use getColumns instead of getTableColumns
CD-Z Feb 18, 2026
41b1cec
fix lint errors
CD-Z Feb 18, 2026
268e0e9
fix release build not being able to start
CD-Z Feb 19, 2026
7e6db97
remove disable lint rule
CD-Z Feb 19, 2026
950519a
improved useLiveQuery
CD-Z Feb 19, 2026
ccd0f6d
Resolve issue with the db queue constructor options
CD-Z Feb 19, 2026
a58b31c
Fix database query issues in library and stats
CD-Z Feb 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src/plugins/types/filterTypes.ts
src/screens/reader/components/ReaderBottomSheet/ReaderValueChange.tsx
# These two files cause the @typescript-eslint/no-unused-vars rule to fail
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
module.exports = {
root: true,
extends: '@react-native',
plugins: ['jest'],
extends: ['@react-native', 'plugin:jest/recommended'],

overrides: [
{
files: ['**/__tests__/**', '**/*.test.*', '**/*.spec.*'],
},
{
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
rules: {
Expand All @@ -17,6 +22,7 @@ module.exports = {
'prefer-const': 'error',
'no-dupe-else-if': 'error',
'no-duplicate-imports': 'error',
'@react-native/no-deep-imports': 0,
},
},
],
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ flake.lock

.cursor/
.agents/
.claude/
.claude/
.jj/
45 changes: 21 additions & 24 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { enableFreeze } from 'react-native-screens';

enableFreeze(true);

import React, { useEffect } from 'react';
import React, { Suspense, useEffect } from 'react';
import { StatusBar, StyleSheet } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import LottieSplashScreen from 'react-native-lottie-splash-screen';
Expand All @@ -14,10 +14,10 @@ import * as Notifications from 'expo-notifications';
import AppErrorBoundary, {
ErrorFallback,
} from '@components/AppErrorBoundary/AppErrorBoundary';
import { useDatabaseInitialization } from '@hooks';

import Main from './src/navigators/Main';
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
import { useInitDatabase } from '@database/db';

Notifications.setNotificationHandler({
handleNotification: async () => {
Expand Down Expand Up @@ -64,14 +64,13 @@ Notifications.setNotificationChannelAsync('tts-controls', {
});

const App = () => {
const { isDbReady, dbError, retryInitialization } =
useDatabaseInitialization();
const state = useInitDatabase();

useEffect(() => {
if (isDbReady || dbError) {
if (state.success || state.error) {
LottieSplashScreen.hide();
}
}, [isDbReady, dbError]);
}, [state.success, state.error]);

useEffect(() => {
const subscription = Notifications.addNotificationResponseReceivedListener(
Expand All @@ -89,27 +88,25 @@ const App = () => {
};
}, []);

if (dbError) {
return <ErrorFallback error={dbError} resetError={retryInitialization} />;
}

if (!isDbReady) {
return null;
if (state.error) {
return <ErrorFallback error={state.error} resetError={() => null} />;
}

return (
<GestureHandlerRootView style={styles.flex}>
<AppErrorBoundary>
<SafeAreaProvider>
<PaperProvider>
<BottomSheetModalProvider>
<StatusBar translucent={true} backgroundColor="transparent" />
<Main />
</BottomSheetModalProvider>
</PaperProvider>
</SafeAreaProvider>
</AppErrorBoundary>
</GestureHandlerRootView>
<Suspense fallback={null}>
<GestureHandlerRootView style={styles.flex}>
<AppErrorBoundary>
<SafeAreaProvider>
<PaperProvider>
<BottomSheetModalProvider>
<StatusBar translucent={true} backgroundColor="transparent" />
<Main />
</BottomSheetModalProvider>
</PaperProvider>
</SafeAreaProvider>
</AppErrorBoundary>
</GestureHandlerRootView>
</Suspense>
);
};

Expand Down
7 changes: 0 additions & 7 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
"plugins": [
"expo-localization",
"react-native-edge-to-edge",
[
"expo-sqlite",
{
"enableFTS": false,
"useSQLCipher": false
}
],
"expo-web-browser"
]
}
Expand Down
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ module.exports = function (api) {
path: '.env',
},
],
[
'inline-import',
{
extensions: ['.sql'],
},
],
],
};
};
7 changes: 7 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'drizzle-kit';

export default defineConfig({
dialect: 'sqlite',
driver: 'expo',
schema: './src/database/schema/index.ts',
});
63 changes: 63 additions & 0 deletions drizzle/20251222152612_past_mandrill/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
CREATE TABLE IF NOT EXISTS `Category` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`name` text NOT NULL,
`sort` integer
);
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS `category_name_unique` ON `Category` (`name`);--> statement-breakpoint
CREATE INDEX IF NOT EXISTS `category_sort_idx` ON `Category` (`sort`);--> statement-breakpoint
CREATE TABLE IF NOT EXISTS `Chapter` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`novelId` integer NOT NULL,
`path` text NOT NULL,
`name` text NOT NULL,
`releaseTime` text,
`bookmark` integer DEFAULT false,
`unread` integer DEFAULT true,
`readTime` text,
`isDownloaded` integer DEFAULT false,
`updatedTime` text,
`chapterNumber` real,
`page` text DEFAULT '1',
`position` integer DEFAULT 0,
`progress` integer
);
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS `chapter_novel_path_unique` ON `Chapter` (`novelId`,`path`);--> statement-breakpoint
CREATE INDEX IF NOT EXISTS `chapterNovelIdIndex` ON `Chapter` (`novelId`,`position`,`page`,`id`);--> statement-breakpoint
CREATE TABLE IF NOT EXISTS `Novel` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`path` text NOT NULL,
`pluginId` text NOT NULL,
`name` text NOT NULL,
`cover` text,
`summary` text,
`author` text,
`artist` text,
`status` text DEFAULT 'Unknown',
`genres` text,
`inLibrary` integer DEFAULT false,
`isLocal` integer DEFAULT false,
`totalPages` integer DEFAULT 0,
`chaptersDownloaded` integer DEFAULT 0,
`chaptersUnread` integer DEFAULT 0,
`totalChapters` integer DEFAULT 0,
`lastReadAt` text,
`lastUpdatedAt` text
);
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS `novel_path_plugin_unique` ON `Novel` (`path`,`pluginId`);--> statement-breakpoint
CREATE INDEX IF NOT EXISTS `NovelIndex` ON `Novel` (`pluginId`,`path`,`id`,`inLibrary`);--> statement-breakpoint
CREATE TABLE IF NOT EXISTS `NovelCategory` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`novelId` integer NOT NULL,
`categoryId` integer NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS `novel_category_unique` ON `NovelCategory` (`novelId`,`categoryId`);--> statement-breakpoint
CREATE TABLE IF NOT EXISTS `Repository` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`url` text NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS `repository_url_unique` ON `Repository` (`url`);
Loading
Loading