Skip to content

Commit

Permalink
Merge branch 'main' into oscar/bring-back-non-host-object-api
Browse files Browse the repository at this point in the history
# Conflicts:
#	example/ios/Podfile.lock
#	package.json
  • Loading branch information
ospfranco committed Sep 11, 2024
2 parents a4500e5 + 58d4af3 commit 043883c
Show file tree
Hide file tree
Showing 36 changed files with 248 additions and 42 deletions.
11 changes: 7 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
assignees: 'ospfranco'
---

BEFORE YOU START!!! DID YOU TAKE A LOOK AT THE DOCUMENTATION?

https://ospfranco.notion.site/OP-SQLite-Documentation-a279a52102464d0cb13c3fa230d2f2dc?pvs=74

**Describe the bug**
A clear and concise description of what the bug is.

Expand All @@ -14,7 +18,6 @@ A clear and concise description of what the bug is.
- OS and version: [e.g. iOS 17]
- op-sqlite version: [Have you tried the latest version?]
- RN version: [e.g. 0.73.0]
- New Architecture: [Yes/No]

**Reproducible example**
Create a minimal reproduction example, otherwise I won't take a look. I'm serious, no example = no solution.
**Link Reproducible example**
CREATE A REPRODUCIBLE EXAMPLE! PLEASE! I DON'T HAVE TIME TO REPRODUCE MOST BUGS!
6 changes: 6 additions & 0 deletions android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ if (USE_CRSQLITE)
)
endif()

if (USE_SQLITE_VEC)
add_definitions(
-DOP_SQLITE_USE_SQLITE_VEC=1
)
endif()

set_target_properties(
${PACKAGE_NAME} PROPERTIES
CXX_STANDARD 20
Expand Down
13 changes: 12 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def useCRSQLite = false
def performanceMode = "0"
def sqliteFlags = ""
def enableFTS5 = false
def useSqliteVec = false

def packageJsonFile = new File("$rootDir/../package.json")
def packageJson = new JsonSlurper().parseText(packageJsonFile.text)
Expand All @@ -41,6 +42,7 @@ def opsqliteConfig = packageJson["op-sqlite"]
if(opsqliteConfig) {
useSQLCipher = opsqliteConfig["sqlcipher"]
useCRSQLite = opsqliteConfig["crsqlite"]
useSqliteVec = opsqliteConfig["sqliteVec"]
performanceMode = opsqliteConfig["performanceMode"] ? opsqliteConfig["performanceMode"] : ""
sqliteFlags = opsqliteConfig["sqliteFlags"] ? opsqliteConfig["sqliteFlags"] : ""
enableFTS5 = opsqliteConfig["fts5"]
Expand Down Expand Up @@ -71,6 +73,10 @@ if(enableFTS5) {
println "[OP-SQLITE] FTS5 enabled! 🔎"
}

if(useSqliteVec) {
println "[OP-SQLITE] Sqlite Vec enabled! ↗️"
}

if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
Expand Down Expand Up @@ -138,14 +144,19 @@ android {
if(enableFTS5) {
cFlags += ["-DSQLITE_ENABLE_FTS4=1", "-DSQLITE_ENABLE_FTS3_PARENTHESIS=1", "-DSQLITE_ENABLE_FTS5=1"]
}
if(useSqliteVec) {
cFlags += "-DOP_SQLITE_USE_SQLITE_VEC=1"
cppFlags += "-DOP_SQLITE_USE_SQLITE_VEC=1"
}

cppFlags "-O2", "-fexceptions", "-frtti", "-std=c++1y", "-DONANDROID"
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
arguments "-DANDROID_STL=c++_shared",
"-DSQLITE_FLAGS='$sqliteFlags'",
"-DUSE_SQLCIPHER=${useSQLCipher ? 1 : 0}",
"-DUSE_CRSQLITE=${useCRSQLite ? 1 : 0}",
"-DUSE_LIBSQL=${useLibsql ? 1 : 0}"
"-DUSE_LIBSQL=${useLibsql ? 1 : 0}",
"-DUSE_SQLITE_VEC=${useSqliteVec ? 1 : 0}"
abiFilters (*reactNativeArchitectures())
}
}
Expand Down
Loading

0 comments on commit 043883c

Please sign in to comment.