williscool / CalendarNotification

Android app extending calendar notifications with snooze button and notifications persistence
GNU General Public License v3.0
4 stars 0 forks source link

[Feature] Database Sync #47

Open williscool opened 1 week ago

williscool commented 1 week ago

want to be able to sync the database so I can do analytics elsewhere (like how many times I snoozed or rescheduled events.

I took a crack at it in #18 but that was a while ago and it seems the electric sql team pivoted to some thing not as good for the use case (literally just want to sync the events database to a remote postgres one)

williscool commented 1 week ago

notes from previous time #18

https://github.com/williscool/CalendarNotification/pull/18/files#diff-83952d3d04f6c59d22a12119fe294ccc1cc3f290ebaeb3850bf607e911a821b0

williscool commented 1 week ago

Notes from looking at powersync for this right now. Looks like with their library I can actually get to the database

https://github.com/powersync-ja/powersync-js/blob/%40powersync/react-native%401.12.2/packages/react-native/src/db/adapters/react-native-quick-sqlite/ReactNativeQuickSQLiteOpenFactory.ts#L12

https://github.com/margelo/react-native-quick-sqlite/blob/8.0.6/android/src/main/java/com/reactnativequicksqlite/QuickSQLiteBridge.java#L19

https://github.com/margelo/react-native-quick-sqlite/blob/8.0.6/cpp/bindings.cpp

https://github.com/margelo/react-native-quick-sqlite/blob/8.0.6/cpp/sqliteBridge.cpp

remembere though powersync uses a fork of

https://github.com/powersync-ja/react-native-quick-sqlite/blob/v1.4.0/cpp/bindings.cpp#L162

williscool commented 1 week ago

also why this wasn't possible with just expo sqlite.

they hardcode the path to be in the /files directory

https://github.com/expo/expo/blob/sdk-51/packages/expo-sqlite/android/src/main/java/expo/modules/sqlite/SQLiteModule.kt#L66