Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
222 commits
Select commit Hold shift + click to select a range
c139e83
New architecture WP 1
marcobambini Dec 9, 2025
aa225f7
New architecture WP 2
marcobambini Dec 10, 2025
0b6d822
WIP 3
marcobambini Dec 10, 2025
9ff3fa4
Optimized cloudsync_table_context interaction
marcobambini Dec 11, 2025
7d1fb60
New architecture WP 4
marcobambini Dec 11, 2025
37d9914
Refactored begin/commit ALTER
marcobambini Dec 12, 2025
4927c64
New architecture WP 6
marcobambini Dec 12, 2025
78c47e3
New architecture (WP 5)
marcobambini Dec 13, 2025
6507a41
Minor changes
marcobambini Dec 13, 2025
ba5b2c8
New architecture WP 6
marcobambini Dec 13, 2025
228bdb0
New architecture WP 7
marcobambini Dec 14, 2025
bf2858d
Small compilation issue fixed
marcobambini Dec 14, 2025
b308432
New architecture WP 9
marcobambini Dec 15, 2025
fa710d3
fix: minor compilation issue
andinux Dec 16, 2025
c1eaa80
fix: database_* functions must call cloudsync_memory_* functions inst…
andinux Dec 16, 2025
d3d66ec
fix(memdebug): fix pointer returned by memdebug_zeroalloc
andinux Dec 16, 2025
e83a721
fix(unittest): avoid a memory leak from do_test_dbutils
andinux Dec 16, 2025
b6c4b84
test: add unittest target to Makefile
andinux Dec 16, 2025
780ddc3
Update unit.c
marcobambini Dec 16, 2025
623be6b
Refactored SQL in dbutils (related to settings)
marcobambini Dec 17, 2025
9979cc7
Updated static statements in cloudsync.c (WP 1)
marcobambini Dec 17, 2025
04f942e
Replaced name escape with a function (WP 2)
marcobambini Dec 17, 2025
344e47d
Completed SQL refactoring
marcobambini Dec 17, 2025
e270092
fix: minor compilation issue
andinux Dec 17, 2025
cb9c591
test: re-add integration test
andinux Dec 17, 2025
f5e1ccd
fix(network): fix the network layer after database-api refactoring
andinux Dec 17, 2025
b4bab23
Several compilation warnings fixed
marcobambini Dec 17, 2025
dbea7de
Cleaned-up 64bit types
marcobambini Dec 17, 2025
96be26a
fix(lcov): exclude sql_sqlite.c from code coverage, it just contains …
andinux Dec 17, 2025
33b3d96
Update cloudsync_sqlite.c
marcobambini Dec 17, 2025
d721843
Merge branch 'database-api' of https://github.com/sqliteai/sqlite-syn…
marcobambini Dec 17, 2025
7bb9476
Use int64_t for version variables in network.c
andinux Dec 17, 2025
be267e9
Update vtab.c
marcobambini Dec 17, 2025
e74f0bf
chore: remove warnings
andinux Dec 17, 2025
295b74f
Merge branch 'database-api' of https://github.com/sqliteai/sqlite-syn…
andinux Dec 17, 2025
6500215
Update vtab.c
marcobambini Dec 17, 2025
b901b36
test: fix compile errors on linux musl
andinux Dec 17, 2025
8e67d24
Replaced all %lld (except one)
marcobambini Dec 17, 2025
023622d
fix: minor compilation error
andinux Dec 17, 2025
657d6d1
refactor: new directory structure to separate multi-platform code fro…
andinux Dec 17, 2025
c0e7154
fix(workflow): add CFLAGS for CURL Android builds and clean up Androi…
Gioee Dec 18, 2025
9f74c87
fix(android): add -fPIC to CFLAGS
Gioee Dec 18, 2025
347c73d
fix(android): use OpenSSL specific version
Gioee Dec 18, 2025
ddcb824
fix(android): update OpenSSL install path to a local one, instead of …
Gioee Dec 19, 2025
0f3ab4b
db_version must be int64_t in network.c
marcobambini Dec 20, 2025
a9d0ae5
fix: avoid crash on postgres when these functions are called with NUL…
andinux Dec 23, 2025
1e89d29
improved error logs, fix some debug messages
andinux Dec 23, 2025
448aa79
New postgresql extension WIP 1
andinux Dec 23, 2025
c261dbb
Updated SQL_DATA_VERSION and added a new sql_build_select_nonpk_by_pk…
marcobambini Dec 23, 2025
917351b
fix: remove obsolete property
andinux Dec 23, 2025
52b205b
chore
andinux Dec 23, 2025
bcfff0c
fix: improved SQL queries (WIP)
andinux Dec 23, 2025
692696f
implement SQL_SCHEMA_VERSION with app_schema_version table and event …
andinux Dec 23, 2025
ec83414
fix: fix PG SQL queries used in cloudsync_init
andinux Dec 23, 2025
b891e33
fix: avoid a segfault crash in cloudsync_init
andinux Dec 27, 2025
84ed166
test: calling twice the cloudsync_init function on postgresql is fail…
andinux Dec 27, 2025
15fda51
Code simplification and memory cleanup (wp)
marcobambini Dec 27, 2025
3e84397
Minor fixes
marcobambini Dec 28, 2025
5c63ef4
test: add debug PostgreSQL devcontainer and Docker setup
andinux Dec 29, 2025
19380d7
chore: update docker/README.md with VS Code Dev Container Debugging i…
andinux Dec 29, 2025
b3ba940
test: add .vscode/launch.json with the "Attach to Postgres (gdb)" con…
andinux Dec 29, 2025
91d26a9
Added more explicit string_dup functions
marcobambini Dec 29, 2025
ca3d79d
Fixed network
marcobambini Dec 29, 2025
0f48a67
Error returned by sqlite3_extension_init function must be dynamically…
marcobambini Dec 30, 2025
bfce62d
test: add debug symbols and src code of postgresql server to dev cont…
andinux Dec 30, 2025
0656307
fix: add SPI_connect and SPI_finish to _PG_init function
andinux Dec 30, 2025
b1c708e
dbutils.c removed db_t
marcobambini Dec 30, 2025
e696656
Minor changes
marcobambini Dec 30, 2025
acbaad5
Refactoring (wp)
marcobambini Dec 30, 2025
2163558
Refactoring (wp)
marcobambini Dec 30, 2025
6998b34
Refactoring (wp)
marcobambini Dec 30, 2025
9d3bc83
Refactoring (wp)
marcobambini Dec 30, 2025
cfb51f8
Refactoring (wp)
marcobambini Dec 30, 2025
b99530e
Refactoring (wp)
marcobambini Dec 30, 2025
b061754
Refactoring (wp)
marcobambini Jan 2, 2026
6260dbc
Refactoring (pg wp)
marcobambini Jan 2, 2026
970bb21
Merge branch 'wip-pg-extension' of https://github.com/sqliteai/sqlite…
marcobambini Jan 2, 2026
8680b28
Various PostgreSQL fixes
marcobambini Jan 2, 2026
ab25deb
Refactoring PG code
marcobambini Jan 3, 2026
2c310e5
chore: minor fixes for when debug macros are enabled
andinux Jan 3, 2026
286f81a
fix: use global memory when the DBFLAG_PERSISTENT flag is set to avoi…
andinux Jan 3, 2026
90ae64f
fix(cloudsync): guard against errmsg aliasing in error formatting
andinux Jan 4, 2026
07c73aa
fix(postgresql): fix error message in cloudsync_init_internal, the er…
andinux Jan 4, 2026
09585a2
fix(postgresql): skip SPI_cursor_open for non-cursorable plans
andinux Jan 4, 2026
6011a0f
Minor fixes
marcobambini Jan 5, 2026
a4b06f5
Improved SPI’s memory ownership rule and prevents accumulation acros…
marcobambini Jan 6, 2026
4523e42
dbmem apis now use pg native memory functions
marcobambini Jan 6, 2026
f44c161
More memory related fixes
marcobambini Jan 6, 2026
ffd587a
Apparently repalloc doesn't like a NULL ptr
marcobambini Jan 6, 2026
13367c1
Update database_postgresql.c
marcobambini Jan 6, 2026
4e614f1
get_cloudsync_context must be allocated in a global context
marcobambini Jan 6, 2026
140d7f9
Revert "get_cloudsync_context must be allocated in a global context"
marcobambini Jan 6, 2026
7758ae3
Revert "Update database_postgresql.c"
marcobambini Jan 6, 2026
e47ef00
Revert "Apparently repalloc doesn't like a NULL ptr"
marcobambini Jan 6, 2026
a8ea296
Revert "More memory related fixes"
marcobambini Jan 6, 2026
8fa2b46
Revert "dbmem apis now use pg native memory functions"
marcobambini Jan 6, 2026
3d98ea5
Several memory related issues fixed
marcobambini Jan 6, 2026
d179b1c
Fixed memory allocations in PG BLOB functions
marcobambini Jan 6, 2026
c71ae6e
pgvalue_vec_push can fails (it now return a bool)
marcobambini Jan 6, 2026
75f60db
Improved memory handling for dbvalue_t
marcobambini Jan 6, 2026
780fe67
fix(sql_postgresql): fix placeholder for cloudsync_memory_mprintf in …
andinux Jan 6, 2026
2a7822b
fix(database_postgresql): refactor error handling in PostgreSQL datab…
andinux Jan 6, 2026
d46ea90
fix(dbutils): dbutils_table_settings_get_value and dbutils_settings_g…
andinux Jan 7, 2026
b302cbb
fix: remove unnecessary switch to top memory context for text_to_cstring
andinux Jan 7, 2026
ff12d4f
fix: if databasevm_bind_text size argurmnt is negative, then the leng…
andinux Jan 7, 2026
fd30ba0
refactor(pgvalue): always alloc values owned by pgvalue struct in the…
andinux Jan 7, 2026
53728d5
chore
andinux Jan 7, 2026
e760836
chore: remove unused SQL queries from sql_postgresql.c
andinux Jan 7, 2026
f3eccd1
fix(sql_postgresql): fix SQL_PRAGMA_TABLEINFO_LIST_NONPK_NAME_CID
andinux Jan 7, 2026
d8ae432
fix(sql_postgresql): SQL_PRAGMA_TABLEINFO_LIST_NONPK_NAME_CID
andinux Jan 7, 2026
d658e33
fix(postgresql): implement triggers and functions called by triggers,…
andinux Jan 7, 2026
07de18d
test(pg smoke test): add tests for cloudsync_pk_encode and for insert…
andinux Jan 7, 2026
86a383d
Minor changes
marcobambini Jan 7, 2026
e512b48
Payload encoding sanity check added
marcobambini Jan 7, 2026
29756f8
Improved dbutils_settings_get_value
marcobambini Jan 7, 2026
34b4bf1
fix(cloudsync_postgresql): cloudsync_init returns the site_id as byte…
andinux Jan 7, 2026
ce4cdfb
chore
andinux Jan 7, 2026
c119ffa
fix(postgresql): lazy-init cloudsync context per call
andinux Jan 7, 2026
499c743
Improved dbutils_table_settings_get_value
andinux Jan 7, 2026
adb6b19
fix: solve a compile error. cloudsync_context is opaque in this compi…
andinux Jan 8, 2026
961b7bc
feat(postgresql): implement cloudsync_update
andinux Jan 8, 2026
d9236cc
chore
andinux Jan 8, 2026
24e13d1
fix(postgresql): fix the PG_TRY/PG_CATCH exception stack, must not re…
andinux Jan 8, 2026
a7430fd
Various improvements to encoding/decoding functions
marcobambini Jan 8, 2026
e3b9015
Improved cloudsync_pg_context_init
marcobambini Jan 9, 2026
77efdb6
Better network memory management
marcobambini Jan 10, 2026
ddb1499
Implemented cloudsync_changes
marcobambini Jan 13, 2026
41597a4
fix: sql_build_rekey_pk_and_reset_version_except_col has different pa…
andinux Jan 13, 2026
51a12bd
fix(cloudsync_postgresql.c): fix implementation of cloudsync_update a…
andinux Jan 13, 2026
35eda28
ci: add new target to build and run the debug version for vscode and …
andinux Jan 13, 2026
f07968a
fix(cloudsync_postgresql): fix memory context for cloudsync_changes (…
andinux Jan 14, 2026
b783d63
Added new pk_encode_value
marcobambini Jan 14, 2026
cdb0b21
fix(sql_postgresql): fix SQL_BUILD_UPSERT_PK_AND_COL query used for …
andinux Jan 15, 2026
afb7358
add a skip_decode_idx argument to pk_decode, used in postgresql
andinux Jan 15, 2026
6fec8ab
fix(cloudsync_postgresql): fix cloudsync_changes_insert_trg to use co…
andinux Jan 15, 2026
b63d52a
test: add read and write tests for cloudsync_changes
andinux Jan 15, 2026
f5b18a3
Renamed PG changes functions and removed unused variable
marcobambini Jan 15, 2026
f3db8fc
No real changes
marcobambini Jan 15, 2026
5c5cc10
Improved cloudsync_changes SELECT
marcobambini Jan 15, 2026
b100edd
Updated cloudsync_changes (wp)
marcobambini Jan 16, 2026
3476f3d
Finished implementing cloudsync_changes
marcobambini Jan 16, 2026
788d37b
fix(pk): the original blob value for the undecoded col_value for the …
andinux Jan 17, 2026
b5479de
fix(pk): add the skip_idx argument for the pk_encode and pk_encode_si…
andinux Jan 17, 2026
dbeef1f
fix(cloudsync): fix the buffer len value (blen) after decompressing a…
andinux Jan 17, 2026
96b4f45
fix(sql_postgresql): fix the SQL_CLOUDSYNC_UPSERT_RAW_COLVERSION for…
andinux Jan 17, 2026
9563e36
fix(sql_postgresql): fix placeholder from ? to $<n> notation for post…
andinux Jan 17, 2026
29068ac
refactor(postgresql): add pgvalue_free function to make it clear how …
andinux Jan 17, 2026
f8ed1f9
chore
andinux Jan 17, 2026
ed63a00
fix(postgresql/coydsync--1.0.sql): fix arguments for cloudsync_payloa…
andinux Jan 17, 2026
9a807c1
Update cloudsync--1.0.sql
andinux Jan 17, 2026
3fff6b1
fix(postgresql): fix cloudsync_changes_insert_trigger for TOMBSTONE rows
andinux Jan 17, 2026
e784dd4
fix(postgresql): trying to fix relcache/plancache/snapshot leaks that…
andinux Jan 17, 2026
6fad31a
test(postgresql/smoke_test): add a test for payload roundtrip to anot…
andinux Jan 17, 2026
f3b47ab
test: minor changes to smoke_test.sql
andinux Jan 17, 2026
413bec0
Added bounds check to pk and checksum to payload
marcobambini Jan 17, 2026
3bd7bd2
test: update include directive for integration test when run with CLO…
andinux Jan 17, 2026
02fe73a
Checksum is checked only if payload version is >= 2
marcobambini Jan 18, 2026
5d531a9
Main synced and improved network layer.
marcobambini Jan 19, 2026
9232c03
Fixed compilation issue
marcobambini Jan 19, 2026
6abe80d
fix(android): renamed endian.h to cloudsync_endian.h to avoid android…
Gioee Jan 19, 2026
bb92d2c
ci: update the dockerfile configurations to use postgresql 17 instead…
andinux Jan 20, 2026
cfe39c0
build(supabase): build a custom supabase/postgres:17.6.1.071 docker i…
andinux Jan 20, 2026
dc85636
test(postgres/smoke_test): update the test to create different databa…
andinux Jan 20, 2026
585e014
Several issues fixed and optimizations added (reported by Claude)
marcobambini Jan 20, 2026
22556b0
skip the schema hash check for now, we cannot compare the hash betwee…
andinux Jan 21, 2026
a58661b
feat(network)!: support the v2 endpoints exposed by the new sqlite-sy…
andinux Jan 21, 2026
29c0cb0
fix: free SPI_tuptable (if exists) after each invocation of SPI_execu…
andinux Jan 21, 2026
4195e48
fix: update the return type for the cloudsync_payload_apply function,…
andinux Jan 21, 2026
7c9b60d
Update database_postgresql.c
andinux Jan 21, 2026
09b4c4f
fix(supabase): prevent a unhealthy status during the restart of the s…
andinux Jan 21, 2026
3689f14
docs(docker/README.md): added a troubleshooting note about the app_sc…
andinux Jan 21, 2026
94c0643
Several memory related issues fixed
marcobambini Jan 21, 2026
d7eccbf
fix(network): token size when calling cloudsync_network_set_token bef…
andinux Jan 22, 2026
4b4026f
fix: bind null values for col_value column in INSERT INTO cloudsync_c…
andinux Jan 22, 2026
c8a9153
fix(postgresql): return raw column in SQL_BUILD_SELECT_COLS_BY_PK_FMT…
andinux Jan 22, 2026
ae111a1
test(postgresql): move the smoke test to the test/postgresql dir
andinux Jan 22, 2026
13dce37
bump version
andinux Jan 22, 2026
42c6d7e
test(postgresql): new multi-db tests
andinux Jan 22, 2026
695719f
chore: add docs with analysis on the open issues
andinux Jan 23, 2026
bce53be
test(postgresql): make 02_roundript.sql test executable as a standalo…
andinux Jan 23, 2026
ff4966b
Update ISSUE_WARNING_resource_was_not_closed.md
andinux Jan 23, 2026
6e689cc
Added support for schema
marcobambini Jan 23, 2026
63fd898
release wip-pg-extension branch node and expo packages to npmjs with …
Gioee Jan 23, 2026
0620ec1
renamed workflows for OIDC publishing issues, to revert before mergin…
Gioee Jan 23, 2026
2ccdcfe
Added new database_internal_table_exists function to make sure to che…
marcobambini Jan 23, 2026
8b6b2d0
fix(workflow): node packages to use pg tagged version
Gioee Jan 23, 2026
45f12fc
fix(packages/node): wrong fat binary artifact folder
Gioee Jan 23, 2026
1fd3ff2
Bump version to 0.9.63
Gioee Jan 23, 2026
971538b
fix(database_postgresql): fix database_select1_value to make it work …
andinux Jan 23, 2026
54f93e0
fix(cloudsync_postgresql): only free quoted identifiers if they're di…
andinux Jan 23, 2026
cbf098a
test(postgresql): add tests for multi-schema scenario
andinux Jan 23, 2026
c1513d3
fix(postgresql): prevent duplicate primary keys when tables exist in …
andinux Jan 23, 2026
e61577e
fix(cloudsync): avoid a crash when setting the cloudsync_set_schema t…
andinux Jan 23, 2026
f9f44a7
test(postgresql): improved tests
andinux Jan 23, 2026
9887c78
Merge branch 'wip-pg-extension' into wip-pg-extension-schema_v2
andinux Jan 23, 2026
cf9863f
Added new define for schema literal
marcobambini Jan 24, 2026
e598b41
fix: skip the decode step regardless of the data type (for the col id…
andinux Jan 24, 2026
aa29fd7
Several minor issues fixed
marcobambini Jan 24, 2026
84f7541
Several other issues fixed
marcobambini Jan 24, 2026
6746f5b
Update network.m
marcobambini Jan 24, 2026
f6efa22
fix: preserve prepared plan across databasevm_reset() in PostgreSQL b…
marcobambini Jan 24, 2026
65c716a
Added new CLOUDSYNC_CHANGES_NCOLS constant
marcobambini Jan 24, 2026
54d7df1
database_value_text returns NULL also in PostgreSQL implementation
marcobambini Jan 24, 2026
f7e5d69
fix(postgres): fix current memory context to avoid crashes on PG_CATC…
andinux Jan 26, 2026
1c6a193
test(postgres): add a test similar to the sport_tracker app
andinux Jan 26, 2026
41c7981
Fixed allocation in value returned after SPI_finish
marcobambini Jan 26, 2026
ac5fc52
Merge branch 'wip-pg-extension' of https://github.com/sqliteai/sqlite…
marcobambini Jan 26, 2026
615eb31
Updated databasevm_step0, databasevm_step and databasevm_clear_bindi…
marcobambini Jan 26, 2026
8fcc81f
Fix for 11_multi_table_rounds.sql
marcobambini Jan 26, 2026
ad11c54
Several minor issues fixed
marcobambini Jan 26, 2026
4f1c548
fix(packages/node): broken dynamic import for platform specific packa…
Gioee Jan 26, 2026
220b959
test(postgresql): improved test for multi_table_multi_columns_rounds …
andinux Jan 26, 2026
2200655
Fixed cloudsync_network_logout
marcobambini Jan 26, 2026
f635a21
fix(network): cleanup the network configuration during network logout
andinux Jan 27, 2026
06727f2
fix: use the correct schema for previously initialized tables on new …
andinux Jan 27, 2026
e8c0b57
test(postgres): build the debug image with no-optimization flag
andinux Jan 27, 2026
6dc7f92
Fixed some issues related to escaping
marcobambini Jan 27, 2026
5e4a938
Quoting and memory issues fixed
marcobambini Jan 27, 2026
0470954
Removed unused files
marcobambini Jan 27, 2026
77dc830
Delete .github/workflows/main.yml
marcobambini Jan 27, 2026
fc4bd9e
Rename rename_to_main_before_merge_to_main_branch.yml to main.yml
marcobambini Jan 27, 2026
5c4182e
Merge branch 'main' into dev
marcobambini Jan 27, 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
17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "cloudsync-postgres-dev",
"dockerComposeFile": [
"../docker/postgresql/docker-compose.debug.yml"
],
"service": "postgres",
"workspaceFolder": "/tmp/cloudsync",
"overrideCommand": false,
"postStartCommand": "pg_isready -U postgres",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools"
]
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -454,4 +454,4 @@ jobs:
files: |
cloudsync-*-${{ steps.tag.outputs.version }}.*
CloudSync-*-${{ steps.tag.outputs.version }}.*
make_latest: true
make_latest: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jniLibs/
*.dex

# IDE
.vscode
.idea/
*.iml
*.swp
Expand Down
37 changes: 37 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Postgres (gdb)",
"type": "cppdbg",
"request": "attach",
"program": "/usr/lib/postgresql/17/bin/postgres",
"processId": "${command:pickProcess}",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"stopAtEntry": false,
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Add PostgreSQL source dir",
"text": "dir /usr/src/postgresql-17/src",
"ignoreFailures": true
},
{
"description": "Map Postgres build paths to source",
"text": "set substitute-path /build/src /usr/src/postgresql-17/src",
"ignoreFailures": true
},
{
"description": "Map Postgres build paths (relative) to source",
"text": "set substitute-path ./build/src /usr/src/postgresql-17/src",
"ignoreFailures": true
}
]
}
]
}
Loading
Loading