Skip to content

Commit e663a51

Browse files
Umang01-hasholxandrSAMMILLERRcoolwednesdaydependabot[bot]
authored
Release/v1.42.4 (#2092)
* doc: gofr/grpc package documentation overview * doc: gofr/datasource package documentation overview * doc: gofr/file package documentation overview * doc: add a dot in the end of a package overview comment for consistency * fix: move grpc package go doc comment to an actual grpc package * docs: fix MongoDB time import and ClickHouse data types - Add missing 'time' import in MongoDB example that uses time.Second - Fix ClickHouse User struct Age field type from string to int - Fix ClickHouse INSERT to use integer value instead of string - Fix typo: 'successful inserted' -> 'successfully inserted' - Revert version file change to 'dev' as requested These changes ensure MongoDB example compiles and ClickHouse example uses consistent data types between struct and INSERT statement. * docs: update package comment for datasource to reflect current usage * docs: fix Dgraph port to use correct gRPC port 9080 DGraph uses gRPC and the default gRPC port is 9080, not 8080. This ensures the example uses the correct port for DGraph connections. * Apply suggestions from code review Co-authored-by: Divya Darshana <98943137+coolwednesday@users.noreply.github.com> * docs: update packages comments according to review * Update pkg/gofr/file/file.go Co-authored-by: Divya Darshana <98943137+coolwednesday@users.noreply.github.com> * build(deps): bump gofr.dev in /examples/using-add-filestore Bumps [gofr.dev](https://github.com/gofr-dev/gofr) from 1.42.2 to 1.42.3. - [Release notes](https://github.com/gofr-dev/gofr/releases) - [Commits](v1.42.2...v1.42.3) --- updated-dependencies: - dependency-name: gofr.dev dependency-version: 1.42.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump gofr.dev in /pkg/gofr/datasource/file/ftp Bumps [gofr.dev](https://github.com/gofr-dev/gofr) from 1.42.2 to 1.42.3. - [Release notes](https://github.com/gofr-dev/gofr/releases) - [Commits](v1.42.2...v1.42.3) --- updated-dependencies: - dependency-name: gofr.dev dependency-version: 1.42.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump golang.org/x/term from 0.32.0 to 0.33.0 Bumps [golang.org/x/term](https://github.com/golang/term) from 0.32.0 to 0.33.0. - [Commits](golang/term@v0.32.0...v0.33.0) --- updated-dependencies: - dependency-name: golang.org/x/term dependency-version: 0.33.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump gofr.dev in /pkg/gofr/datasource/pubsub/eventhub Bumps [gofr.dev](https://github.com/gofr-dev/gofr) from 1.42.2 to 1.42.3. - [Release notes](https://github.com/gofr-dev/gofr/releases) - [Commits](v1.42.2...v1.42.3) --- updated-dependencies: - dependency-name: gofr.dev dependency-version: 1.42.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump google.golang.org/api from 0.238.0 to 0.241.0 Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.238.0 to 0.241.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](googleapis/google-api-go-client@v0.238.0...v0.241.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-version: 0.241.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/surrealdb/surrealdb.go Bumps [github.com/surrealdb/surrealdb.go](https://github.com/surrealdb/surrealdb.go) from 0.3.2 to 0.3.3. - [Release notes](https://github.com/surrealdb/surrealdb.go/releases) - [Changelog](https://github.com/surrealdb/surrealdb.go/blob/main/RELEASE_NOTES.md) - [Commits](surrealdb/surrealdb.go@v0.3.2...v0.3.3) --- updated-dependencies: - dependency-name: github.com/surrealdb/surrealdb.go dependency-version: 0.3.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/redis/go-redis/extra/redisotel/v9 Bumps [github.com/redis/go-redis/extra/redisotel/v9](https://github.com/redis/go-redis) from 9.10.0 to 9.11.0. - [Release notes](https://github.com/redis/go-redis/releases) - [Changelog](https://github.com/redis/go-redis/blob/master/CHANGELOG.md) - [Commits](redis/go-redis@v9.10.0...v9.11.0) --- updated-dependencies: - dependency-name: github.com/redis/go-redis/extra/redisotel/v9 dependency-version: 9.11.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump gofr.dev in /pkg/gofr/datasource/file/s3 Bumps [gofr.dev](https://github.com/gofr-dev/gofr) from 1.42.2 to 1.42.3. - [Release notes](https://github.com/gofr-dev/gofr/releases) - [Commits](v1.42.2...v1.42.3) --- updated-dependencies: - dependency-name: gofr.dev dependency-version: 1.42.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump gofr.dev in /pkg/gofr/datasource/file/sftp Bumps [gofr.dev](https://github.com/gofr-dev/gofr) from 1.42.2 to 1.42.3. - [Release notes](https://github.com/gofr-dev/gofr/releases) - [Commits](v1.42.2...v1.42.3) --- updated-dependencies: - dependency-name: gofr.dev dependency-version: 1.42.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump gofr.dev in /pkg/gofr/datasource/pubsub/nats Bumps [gofr.dev](https://github.com/gofr-dev/gofr) from 1.42.2 to 1.42.3. - [Release notes](https://github.com/gofr-dev/gofr/releases) - [Commits](v1.42.2...v1.42.3) --- updated-dependencies: - dependency-name: gofr.dev dependency-version: 1.42.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump golang.org/x/text from 0.26.0 to 0.27.0 Bumps [golang.org/x/text](https://github.com/golang/text) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/golang/text/releases) - [Commits](golang/text@v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-version: 0.27.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * add missing table end tag in redis documentation * Update page.md Fix and clean up ScyllaDB documentation example * fix and clean up ScyllaDB documentation example * refactor newContext to avoid creating contextLogger separately * fix tests * resolve linter * remove context embedding in cmd struct and add contextLogger in newCMD method * Elasticsearch migration (#2051) * fixed docs rendering issue * minor fix * add elasticsearch documentation * minor fix * Remove redundant docs (#2093) * skip-coverage-workflow (#2094) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: olxandr <31043927+olxandr@users.noreply.github.com> Co-authored-by: olxandr <voronko.olexandr@gmail.com> Co-authored-by: SAMMILLERR <saatvik.pandey.cd.che22@itbhu.ac.in> Co-authored-by: Divya Darshana <98943137+coolwednesday@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vikash Kumar <vikash.iitb@gmail.com> Co-authored-by: Dhruv Rishikesh Janakala <dhruv.janakala.social@gmail.com> Co-authored-by: Arihant Pal <arihant0pal@gmail.com> Co-authored-by: Zopdev <zopdev@adsl-172-0-201-112.dsl.hstntx.sbcglobal.net> Co-authored-by: coolwednesday <divi229moc@gmail.com>
2 parents 4bcc782 + 27c3f79 commit e663a51

File tree

46 files changed

+1703
-351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1703
-351
lines changed

.github/workflows/go.yml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -276,44 +276,44 @@ jobs:
276276
path: coverage_reports/*.cov
277277

278278
# Job for uploading coverage to external services (CodeClimate)
279-
upload_coverage:
280-
name: Upload Coverage📊
281-
runs-on: ubuntu-latest
282-
# This job only needs example and pkg test results, not submodules
283-
needs: [Example-Unit-Testing, PKG-Unit-Testing]
284-
# Only run this job on pushes to the development branch
285-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development'}}
286-
steps:
287-
- name: Check out code into the Go module directory
288-
uses: actions/checkout@v4
289-
290-
# Download coverage artifacts
291-
- name: Download Coverage Report
292-
uses: actions/download-artifact@v4
293-
with:
294-
path: artifacts
295-
296-
# Merge coverage from example and pkg tests only
297-
- name: Merge Coverage Files
298-
working-directory: artifacts
299-
run: |
300-
echo "mode: set" > merged_profile.cov
301-
tail -n +2 ./Example-Test-Report/profile.cov >> merged_profile.cov
302-
tail -n +2 ./PKG-Coverage-Report/profile.cov >> merged_profile.cov
303-
304-
# Generate and print total coverage percentage
305-
echo "Total Coverage:"
306-
go tool cover -func=merged_profile.cov | tail -n 1
307-
shell: bash
308-
309-
# Upload merged coverage to CodeClimate for analysis
310-
- name: Upload
311-
uses: paambaati/codeclimate-action@v9.0.0
312-
env:
313-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
314-
with:
315-
coverageLocations: artifacts/merged_profile.cov:gocov
316-
prefix: gofr.dev
279+
# upload_coverage:
280+
# name: Upload Coverage📊
281+
# runs-on: ubuntu-latest
282+
# # This job only needs example and pkg test results, not submodules
283+
# needs: [Example-Unit-Testing, PKG-Unit-Testing]
284+
# # Only run this job on pushes to the development branch
285+
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development'}}
286+
# steps:
287+
# - name: Check out code into the Go module directory
288+
# uses: actions/checkout@v4
289+
#
290+
# # Download coverage artifacts
291+
# - name: Download Coverage Report
292+
# uses: actions/download-artifact@v4
293+
# with:
294+
# path: artifacts
295+
#
296+
# # Merge coverage from example and pkg tests only
297+
# - name: Merge Coverage Files
298+
# working-directory: artifacts
299+
# run: |
300+
# echo "mode: set" > merged_profile.cov
301+
# tail -n +2 ./Example-Test-Report/profile.cov >> merged_profile.cov
302+
# tail -n +2 ./PKG-Coverage-Report/profile.cov >> merged_profile.cov
303+
#
304+
# # Generate and print total coverage percentage
305+
# echo "Total Coverage:"
306+
# go tool cover -func=merged_profile.cov | tail -n 1
307+
# shell: bash
308+
#
309+
# # Upload merged coverage to CodeClimate for analysis
310+
# - name: Upload
311+
# uses: paambaati/codeclimate-action@v9.0.0
312+
# env:
313+
# CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
314+
# with:
315+
# coverageLocations: artifacts/merged_profile.cov:gocov
316+
# prefix: gofr.dev
317317

318318
# Job for code quality checks
319319
code_quality:

docs/advanced-guide/handling-data-migrations/page.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,41 @@ func createTableEmployeeCassandra() migration.Migrate {
238238
}
239239
```
240240

241+
## Migrations in ElasticSearch
242+
243+
GoFr allows Elasticsearch document migrations, focusing on **single document** and **bulk operations**.
244+
245+
### Single Document Migration
246+
247+
```go
248+
func addSingleProduct() migration.Migrate {
249+
return migration.Migrate{
250+
UP: func(d migration.Datasource) error {
251+
product := map[string]any{
252+
"title": "Laptop",
253+
"price": 999.99,
254+
"category": "electronics",
255+
}
256+
257+
return d.Elasticsearch.IndexDocument( context.Background(), "products", "1", product, ) }, }
258+
}
259+
```
260+
261+
### Bulk Operation Migration
262+
263+
```go
264+
func bulkProducts() migration.Migrate {
265+
return migration.Migrate{
266+
UP: func(d migration.Datasource) error {
267+
operations := []map[string]any{
268+
{"index": map[string]any{"_index": "products", "_id": "1"}},
269+
{"title": "Phone", "price": 699.99, "category": "electronics"},
270+
{"index": map[string]any{"_index": "products", "_id": "2"}},
271+
{"title": "Mug", "price": 12.99, "category": "kitchen"},
272+
}
273+
274+
_, err := d.Elasticsearch.Bulk(context.Background(), operations) return err },}
275+
}
276+
```
277+
241278
> ##### Check out the example to add and run migrations in GoFr: [Visit GitHub](https://github.com/gofr-dev/gofr/blob/main/examples/using-migrations/main.go)

docs/datasources/clickhouse/page.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ package main
2525

2626
import (
2727
"gofr.dev/pkg/gofr"
28-
2928
"gofr.dev/pkg/gofr/datasource/clickhouse"
3029
)
3130

3231
type User struct {
3332
Id string `ch:"id"`
3433
Name string `ch:"name"`
35-
Age string `ch:"age"`
34+
Age int `ch:"age"`
3635
}
3736

3837
func main() {
@@ -52,12 +51,12 @@ func main() {
5251
}
5352

5453
func Post(ctx *gofr.Context) (any, error) {
55-
err := ctx.Clickhouse.Exec(ctx, "INSERT INTO users (id, name, age) VALUES (?, ?, ?)", "8f165e2d-feef-416c-95f6-913ce3172e15", "aryan", "10")
54+
err := ctx.Clickhouse.Exec(ctx, "INSERT INTO users (id, name, age) VALUES (?, ?, ?)", "8f165e2d-feef-416c-95f6-913ce3172e15", "aryan", 10)
5655
if err != nil {
5756
return nil, err
5857
}
5958

60-
return "successful inserted", nil
59+
return "successfully inserted", nil
6160
}
6261

6362
func Get(ctx *gofr.Context) (any, error) {

docs/datasources/dgraph/page.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func main() {
6868

6969
db := dgraph.New(dgraph.Config{
7070
Host: "localhost",
71-
Port: "8080",
71+
Port: "9080",
7272
})
7373

7474
// Connect to Dgraph running on localhost:9080

docs/datasources/getting-started/page.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ as unnecessary database drivers are not being compiled and added to the build.
167167
-
168168
-
169169
-
170-
-
170+
-
171171

172172
---
173173

0 commit comments

Comments
 (0)