Skip to content

Commit 1678500

Browse files
committed
add: opensearch
1 parent 555501f commit 1678500

File tree

10 files changed

+644
-1
lines changed

10 files changed

+644
-1
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SOURCE ?= file go_bindata github github_ee bitbucket aws_s3 google_cloud_storage godoc_vfs gitlab
2-
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgx5 rqlite
2+
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgx5 rqlite opensearch
33
DATABASE_TEST ?= $(DATABASE) sqlite sqlite3 sqlcipher
44
VERSION ?= $(shell git describe --tags 2>/dev/null | cut -c 2-)
55
TEST_FLAGS ?=

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Database drivers run migrations. [Add a new database?](database/driver.go)
4444
* [Firebird](database/firebird)
4545
* [MS SQL Server](database/sqlserver)
4646
* [rqlite](database/rqlite)
47+
* [OpenSearch](database/opensearch)
4748

4849
### Database URLs
4950

database/opensearch/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# OpenSearch
2+
3+
* Driver work with OpenSearch through [OpenSearch REST API](https://opensearch.org/docs/latest/getting-started/communicate/#opensearch-rest-api)
4+
* Migrations are written in JSON format and support actions such as creating indices, updating mappings, modifying settings and etc.
5+
* [Examples](./examples)
6+
7+
# Usage
8+
9+
`opensearch://user:password@host:port/index`
10+
11+
| URL Query | Default value | Description |
12+
|------------|---------------------|-------------|
13+
| `index` | `.migrations` | Name of the migrations index |
14+
| `timeout` | `60s` | The max time that an operation will wait before failing. |
15+
| `user` | | The user to sign in as. Can be omitted |
16+
| `password` | | The user's password. Can be omitted |
17+
| `host` | | The host to connect to |
18+
| `port` | | The port to bind to |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"action": "DELETE /test-index",
3+
"body": {}
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"action": "PUT /test-index",
3+
"body": {
4+
"settings": {
5+
"number_of_shards": 1,
6+
"number_of_replicas": 0
7+
},
8+
"mappings": {
9+
"properties": {
10+
"title": {
11+
"type": "text"
12+
}
13+
}
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)