Skip to content
Merged
Show file tree
Hide file tree
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
103 changes: 103 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
name: Bug Report
about: Report a bug in rhosocial ActiveRecord PostgreSQL Backend
title: '[POSTGRES-BUG] '
labels: 'bug, postgres'
assignees: ''
---

## Before Submitting

Please ensure this bug is specific to the PostgreSQL backend implementation. If the issue occurs across all backends (involving ActiveRecord/ActiveQuery functionality), please submit the issue at https://github.com/rhosocial/python-activerecord/issues instead.

## Description

A clear and concise description of the bug in the PostgreSQL backend.

## Environment

- **rhosocial ActiveRecord PostgreSQL Version**: [e.g. 1.0.0.dev13]
- **rhosocial ActiveRecord Core Version**: [e.g. 1.0.0.dev13]
- **Python Version**: [e.g. 3.13]
- **PostgreSQL Version**: [e.g. 15.x, 14.x, 13.x]
- **psycopg Version**: [e.g. psycopg 3.2.0]
- **OS**: [e.g. Linux, macOS, Windows]

## Steps to Reproduce

1.
2.
3.

## Expected Behavior

A clear and concise description of what you expected to happen.

## Actual Behavior

What actually happened instead of the expected behavior.

## Database Query

If applicable, provide the generated SQL query that causes the issue:

```sql
-- Your problematic SQL query here
```

## Model Definition

If the issue is related to a specific model, please share your model definition:

```python
# Example model definition
class User(ActiveRecord):
__table_name__ = 'users'

id: Optional[int] = None
name: str
email: EmailStr
```

## PostgreSQL-Specific Configuration

Any PostgreSQL-specific configuration that might be relevant:

```python
config = PostgreSQLConnectionConfig(
host='localhost',
port=5432,
database='test',
username='user',
password='password',
# Add your specific options here
)
```

## PostgreSQL Features Used

Which PostgreSQL-specific features are involved in this bug? (Select all that apply)

- [ ] JSON/JSONB operations
- [ ] Array operations
- [ ] Window functions
- [ ] Common Table Expressions (CTEs)
- [ ] Recursive CTEs
- [ ] Full-text search
- [ ] Geometric types
- [ ] Network address types
- [ ] Range types
- [ ] UUID type
- [ ] Custom types

## Error Details

If you're getting an error, include the full error message and stack trace:

```
Paste the full error message here
```

## Additional Context

Any other context about the problem here.
67 changes: 67 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: Feature Request
about: Suggest a feature for rhosocial ActiveRecord PostgreSQL Backend
title: '[POSTGRES-FEATURE] '
labels: 'enhancement, postgres'
assignees: ''
---

## Before Submitting

Please ensure this feature request is specific to the PostgreSQL backend implementation. If the feature is related to ActiveRecord/ActiveQuery functionality that should be consistent across all backends, please submit the feature request at https://github.com/rhosocial/python-activerecord/issues instead.

## Description

A clear and concise description of the desired feature for the PostgreSQL backend.

## Problem Statement

Is your feature request related to a specific problem? Please describe.

## Proposed Solution

Describe the solution you'd like to see implemented in the PostgreSQL backend.

## PostgreSQL-Specific Use Cases

What specific PostgreSQL use cases would this feature address?

1.
2.

## PostgreSQL Features & Capabilities

Does this feature relate to specific PostgreSQL capabilities? (Select all that apply)

- [ ] JSON/JSONB operations
- [ ] Array operations
- [ ] Window functions
- [ ] Common Table Expressions (CTEs)
- [ ] Recursive CTEs
- [ ] Full-text search
- [ ] Geometric types (PostGIS integration)
- [ ] Network address types
- [ ] Range types
- [ ] UUID type
- [ ] Custom enumerations (ENUM)
- [ ] Custom data types
- [ ] Advanced aggregation functions
- [ ] Materialized views support

## Technical Considerations

Are there any technical constraints or considerations specific to PostgreSQL for implementing this feature?

## Comparison with Alternatives

How does this feature compare to alternative approaches in the PostgreSQL ecosystem?

## Impact Assessment

- **Compatibility**: Will this feature be backward compatible with existing PostgreSQL installations?
- **Performance**: Are there any performance implications for PostgreSQL queries?
- **Migration**: Would this require database schema changes or migration steps?

## Additional Context

Add any other context or examples about the feature request here.
26 changes: 24 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Python Package Publish

on:
# 当测试工作流成功完成时自动触发发布审批流程
workflow_run:
workflows: ["Python Test and Coverage"]
types:
- completed
branches:
- main

# 手动触发发布工作流
workflow_dispatch:
inputs:
Expand All @@ -18,10 +26,23 @@ permissions:
packages: write

jobs:
# 检查测试工作流是否成功完成
check-tests:
runs-on: ubuntu-latest
if: >
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') ||
github.event_name == 'workflow_dispatch'
steps:
- name: Success check
run: echo "前置测试通过,可以继续执行发布流程"

# 发布到TestPyPI
publish-testpypi:
name: Publish to TestPyPI
if: github.event.inputs.destination == 'testpypi'
needs: check-tests
if: >
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.destination == 'testpypi')
runs-on: ubuntu-latest
environment: publish-testpypi # 使用需要审批的环境
permissions:
Expand Down Expand Up @@ -55,7 +76,8 @@ jobs:
# 发布到PyPI
publish-pypi:
name: Publish to PyPI
if: github.event.inputs.destination == 'pypi'
needs: check-tests
if: github.event_name == 'workflow_dispatch' && github.event.inputs.destination == 'pypi'
runs-on: ubuntu-latest
environment: publish-pypi # 使用需要严格审批的环境
permissions:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# rhosocial ActiveRecord postgres Backend ($\rho_{\mathbf{AR}}^{postgres}$)
# rhosocial-activerecord-postgres ($\rho_{\mathbf{AR}\text{-postgres}}$)

[![PyPI version](https://badge.fury.io/py/rhosocial-activerecord-postgres.svg)](https://badge.fury.io/py/rhosocial-activerecord-postgres)
[![Python](https://img.shields.io/pypi/pyversions/rhosocial-activerecord-postgres.svg)](https://pypi.org/project/rhosocial-activerecord-postgres/)
Expand All @@ -12,7 +12,7 @@
<p>postgres backend implementation for rhosocial-activerecord, providing a robust and optimized postgres database support.</p>
</div>

# postgres Backend Implementation Guide
# Postgres Backend Implementation Guide

## Overview

Expand Down
1 change: 1 addition & 0 deletions changelog.d/1.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add backend CLI tool functionality for database operations
Loading