10 Commits

Author SHA1 Message Date
00db0cf6e6 Remove dependency from OSS to enterprise packages by moving Spanner functions to xorm. (#102692)
* Remove dependency from OSS to enterprise packages by moving Spanner functions to xorm.
2025-03-24 12:16:12 +01:00
8db050af6b Use in-memory sequence number generator when running integration tests against Spanner emulator. (#102522) 2025-03-20 16:50:50 +01:00
0c58d39e76 Spanner-related fixes (#102376)
* Fix UNION syntax in resourcepermissions package.
* Fix migrations in usermig package to work with Spanner.
* Fix health query.
* Use more connections for integration tests.
* Add test-go-integration-spanner target to run integration tests against Spanner emulator.
* Add test for enterprise.
* Don't delete sequence number for migration_log.id column.

* Only bump max open connections to 20 for Spanner.
Lower integration test timeout.
2025-03-19 12:34:44 +01:00
0bafd4e99d unistore: update spanner ddl to include unistore tables (#102198)
* provision unistore tables

* update the tests to use generated namespace

* update ddl

* update ddl

* clean streams

* missing space

* use engine.db.query
2025-03-18 14:37:11 +01:00
11552e5c57 Speed up truncation of Spanner tables (used in integration tests) (#102278)
Speed up truncation of Spanner tables.
2025-03-17 15:05:01 +01:00
8625a6c131 Export SpannerConnectorConfigToClientOptions function (used by grafana-enterprise). (#102106)
* Export SpannerConnectorConfigToClientOptions function (used by grafana-enterprise).
2025-03-14 10:07:24 +01:00
f3df64b7f4 Pass BOOL values as real types (int/bool) instead of strings to SQL parameters. (#101961)
* Pass BOOL values as real types (int/bool) instead of strings to SQL parameters.

Fixes following integration tests when running with Spanner:
* TestIntegrationDataAccess
    * GetDataSourcesByType/Get_prunable_data_sources
* TestIntegrationUserAuthToken:
    * expires_correctly
    * can_properly_rotate_tokens
    *  keeps_prev_token_valid_for_1_minute_after_it_is_confirmed

* Fix more places where "true" or "false" string was passed as query parameter instead of bool value.

* Removed unit test because it brought unwanted dependencies on xorm into multiple modules.
2025-03-12 15:40:11 +01:00
fd6a4908f1 Support Spanner's UNION syntax, which needs to be UNION DISTINCT or UNION ALL. (#101768)
* Support Spanner's UNION syntax, which needs to be UNION DISTINCT or UNION ALL.
2025-03-10 12:33:52 +01:00
9e690bd620 Spanner support enhancements (#101634)
* Adds ability to run integration tests against spanner (by using GRAFANA_TEST_DB=spanner env variable. SPANNER_DB variable then specifies database to use: spannertest, emulator or string like /projects/<project>/instances/<instance>/databases/<db>)
* Adds feature to migration dialects to create database from a snapshot, instead of running individual migrations.
* Adds first version of Spanner snapshot, prepared from "OSS" migrations.
* Uses generated bit-reversed-positive values instead of auto_increment. (As an experiment)
2025-03-06 16:11:20 +01:00
165bca6417 Chore: Add initial/experimental xorm spanner driver (#101398)
* make it build and start

* run some migrations

* add build tags, remove log

* remove unused code

* revert go.mod changes

* move initialisation into dialect file

* update workspace

* update workspace once again

* clean up dependencies

* further cleanup

* Address some review feedback.

* Fix go.sum.

---------

Co-authored-by: Peter Štibraný <pstibrany@gmail.com>
2025-03-03 17:02:10 +01:00