Skip to content
Merged
Changes from all commits
Commits
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
118 changes: 110 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,125 @@
# SQL GORM for Tinh Tinh

<div>
<div align="center">
<img alt="GitHub Release" src="https://img.shields.io/github/v/release/tinh-tinh/sqlorm">
<img alt="GitHub License" src="https://img.shields.io/github/license/tinh-tinh/sqlorm">
<a href="https://codecov.io/gh/tinh-tinh/sqlorm" >
<img src="https://codecov.io/gh/tinh-tinh/sqlorm/graph/badge.svg?token=TS4B5QAO3T"/>
<a href="https://codecov.io/gh/tinh-tinh/sqlorm">
<img src="https://codecov.io/gh/tinh-tinh/sqlorm/graph/badge.svg?token=TS4B5QAO3T"/>
</a>
Comment on lines +6 to 8
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove Codecov token and add alt text (security + a11y).

Public repos don't need the token in the badge URL; also add alt to satisfy MD045.

 <a href="https://codecov.io/gh/tinh-tinh/sqlorm">
-    <img src="https://codecov.io/gh/tinh-tinh/sqlorm/graph/badge.svg?token=TS4B5QAO3T"/>
+    <img src="https://codecov.io/gh/tinh-tinh/sqlorm/graph/badge.svg" alt="codecov coverage badge"/>
 </a>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<a href="https://codecov.io/gh/tinh-tinh/sqlorm">
<img src="https://codecov.io/gh/tinh-tinh/sqlorm/graph/badge.svg?token=TS4B5QAO3T"/>
</a>
<a href="https://codecov.io/gh/tinh-tinh/sqlorm">
<img src="https://codecov.io/gh/tinh-tinh/sqlorm/graph/badge.svg" alt="codecov coverage badge"/>
</a>
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

7-7: Images should have alternate text (alt text)

(MD045, no-alt-text)

🤖 Prompt for AI Agents
In README.md around lines 6 to 8, the Codecov badge includes a token in the
image URL and the <img> lacks alt text; remove the query parameter token from
the badge src (delete "?token=TS4B5QAO3T") and add an appropriate alt attribute
to the image (e.g., alt="Codecov coverage badge") so the badge URL is token-free
and accessible.

<a href="https://pkg.go.dev/github.com/tinh-tinh/sqlorm"><img src="https://pkg.go.dev/badge/github.com/tinh-tinh/sqlorm.svg" alt="Go Reference"></a>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Point pkg.go.dev badge to v2 module path.

The repo uses v2 in Installation; align the badge link.

-<a href="https://pkg.go.dev/github.com/tinh-tinh/sqlorm"><img src="https://pkg.go.dev/badge/github.com/tinh-tinh/sqlorm.svg" alt="Go Reference"></a>
+<a href="https://pkg.go.dev/github.com/tinh-tinh/sqlorm/v2"><img src="https://pkg.go.dev/badge/github.com/tinh-tinh/sqlorm/v2.svg" alt="Go Reference"></a>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<a href="https://pkg.go.dev/github.com/tinh-tinh/sqlorm"><img src="https://pkg.go.dev/badge/github.com/tinh-tinh/sqlorm.svg" alt="Go Reference"></a>
<a href="https://pkg.go.dev/github.com/tinh-tinh/sqlorm/v2"><img src="https://pkg.go.dev/badge/github.com/tinh-tinh/sqlorm/v2.svg" alt="Go Reference"></a>
🤖 Prompt for AI Agents
In README.md around line 9, the pkg.go.dev badge currently points to
github.com/tinh-tinh/sqlorm; update the badge URL and target link to the v2
module path (github.com/tinh-tinh/sqlorm/v2) so it matches the Installation
section. Replace both the href and the image src/alt target to reference the /v2
module path (i.e., point the badge link to
pkg.go.dev/github.com/tinh-tinh/sqlorm/v2 and use the corresponding badge URL).

</div>

<div align="center">
<img src="https://avatars.githubusercontent.com/u/178628733?s=400&u=2a8230486a43595a03a6f9f204e54a0046ce0cc4&v=4" width="200" alt="Tinh Tinh Logo">
</div>

![](https://avatars.githubusercontent.com/u/178628733?s=400&u=2a8230486a43595a03a6f9f204e54a0046ce0cc4&v=4)
## Overview

SQL GORM for Tinh Tinh is a powerful database toolkit designed to work seamlessly with the Tinh Tinh framework. It provides an elegant and efficient way to interact with SQL databases using GORM, the fantastic ORM library for Golang.

## Features

## Description
- 🚀 Full GORM integration with Tinh Tinh
- 📦 Easy-to-use database operations
- 🔄 Auto Migration support
- 🎯 Type-safe query building
- 🛠️ Advanced features like:
- Associations handling
- Hooks
- Transactions
- Custom data types
- And more!

Package Gorm for Tinh Tinh
## Installation

## Install
To install the package, use:

```bash
go get -u github.com/tinh-tinh/sqlorm/v2
```
```

## Quick Start

```go
package main

import (
"github.com/tinh-tinh/sqlorm/v2"
)

// User represents your database model
type User struct {
ID uint `gorm:"primarykey"`
Name string
Email string
}

func main() {
// Initialize your database connection
db := sqlorm.New(&sqlorm.Config{
Driver: "postgres",
Host: "localhost",
Port: 5432,
Database: "mydb",
Username: "user",
Password: "password",
})

// Auto migrate your models
db.AutoMigrate(&User{})

// Create a new user
user := User{
Name: "John Doe",
Email: "john@example.com",
}
db.Create(&user)
}
```

## Configuration

The package supports various database configurations:

```go
type Config struct {
Driver string // "postgres", "mysql", "sqlite"
Host string
Port int
Database string
Username string
Password string
SSLMode string
TimeZone string
}
```

## Supported Databases

- PostgreSQL
- MySQL
- SQLite
- Microsoft SQL Server

## Documentation

For detailed documentation and examples, please visit:
- [Go Package Documentation](https://pkg.go.dev/github.com/tinh-tinh/sqlorm)
- [GORM Official Documentation](https://gorm.io/docs/)
Comment on lines +107 to +108
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix documentation link to v2 module.

Ensure the package docs link matches the module major version.

-- [Go Package Documentation](https://pkg.go.dev/github.com/tinh-tinh/sqlorm)
+- [Go Package Documentation](https://pkg.go.dev/github.com/tinh-tinh/sqlorm/v2)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- [Go Package Documentation](https://pkg.go.dev/github.com/tinh-tinh/sqlorm)
- [GORM Official Documentation](https://gorm.io/docs/)
[Go Package Documentation](https://pkg.go.dev/github.com/tinh-tinh/sqlorm/v2)
- [GORM Official Documentation](https://gorm.io/docs/)
🧰 Tools
🪛 LanguageTool

[grammar] ~107-~107: There might be a mistake here.
Context: ...lease visit: - Go Package Documentation - [GORM Official Documentation](https://gor...

(QB_NEW_EN)

🤖 Prompt for AI Agents
In README.md around lines 107 to 108, the Go package documentation link points
to the module root without the major version suffix; update the pkg.go.dev URL
to include the module major version (e.g. change to
https://pkg.go.dev/github.com/tinh-tinh/sqlorm/v2) so the documentation matches
the v2 module.


## Contributing

We welcome contributions! Here's how you can help:

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## Support

If you encounter any issues or need help, you can:
- Open an issue in the GitHub repository
- Check our documentation
- Join our community discussions