sqlobjects 1.0.12__tar.gz → 1.0.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. {sqlobjects-1.0.12/sqlobjects.egg-info → sqlobjects-1.0.14}/PKG-INFO +3 -4
  2. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/pyproject.toml +6 -7
  3. sqlobjects-1.0.14/sqlobjects/_install_rules.py +121 -0
  4. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/session.py +18 -1
  5. {sqlobjects-1.0.12 → sqlobjects-1.0.14/sqlobjects.egg-info}/PKG-INFO +3 -4
  6. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects.egg-info/SOURCES.txt +1 -4
  7. sqlobjects-1.0.14/sqlobjects.egg-info/entry_points.txt +2 -0
  8. sqlobjects-1.0.14/sqlobjects.egg-info/requires.txt +1 -0
  9. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects.egg-info/top_level.txt +0 -1
  10. sqlobjects-1.0.12/CHANGELOG.md +0 -103
  11. sqlobjects-1.0.12/scripts/__init__.py +0 -1
  12. sqlobjects-1.0.12/scripts/install_rules.py +0 -90
  13. sqlobjects-1.0.12/setup.py +0 -7
  14. sqlobjects-1.0.12/sqlobjects.egg-info/entry_points.txt +0 -2
  15. sqlobjects-1.0.12/sqlobjects.egg-info/requires.txt +0 -1
  16. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/LICENSE +0 -0
  17. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/README.md +0 -0
  18. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/docs/rules/01-database-session-guide.md +0 -0
  19. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/docs/rules/02-model-definition-guide.md +0 -0
  20. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/docs/rules/03-query-operations-guide.md +0 -0
  21. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/docs/rules/04-crud-operations-guide.md +0 -0
  22. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/docs/rules/05-relationships-guide.md +0 -0
  23. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/docs/rules/06-validation-signals-guide.md +0 -0
  24. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/docs/rules/07-performance-guide.md +0 -0
  25. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/docs/rules/README.md +0 -0
  26. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/setup.cfg +0 -0
  27. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/__init__.py +0 -0
  28. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/cascade.py +0 -0
  29. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/database/__init__.py +0 -0
  30. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/database/config.py +0 -0
  31. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/database/manager.py +0 -0
  32. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/exceptions.py +0 -0
  33. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/expressions/__init__.py +0 -0
  34. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/expressions/aggregate.py +0 -0
  35. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/expressions/base.py +0 -0
  36. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/expressions/function.py +0 -0
  37. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/expressions/mixins.py +0 -0
  38. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/expressions/scalar.py +0 -0
  39. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/expressions/subquery.py +0 -0
  40. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/expressions/terminal.py +0 -0
  41. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/__init__.py +0 -0
  42. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/core.py +0 -0
  43. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/functions.py +0 -0
  44. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/proxies.py +0 -0
  45. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/relations/__init__.py +0 -0
  46. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/relations/descriptors.py +0 -0
  47. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/relations/managers.py +0 -0
  48. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/relations/prefetch.py +0 -0
  49. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/relations/strategies.py +0 -0
  50. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/relations/utils.py +0 -0
  51. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/shortcuts.py +0 -0
  52. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/types/__init__.py +0 -0
  53. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/types/base.py +0 -0
  54. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/types/comparators.py +0 -0
  55. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/types/registry.py +0 -0
  56. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/fields/utils.py +0 -0
  57. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/internal/__init__.py +0 -0
  58. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/internal/operations.py +0 -0
  59. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/internal/results.py +0 -0
  60. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/metadata.py +0 -0
  61. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/mixins.py +0 -0
  62. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/model.py +0 -0
  63. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/objects/__init__.py +0 -0
  64. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/objects/bulk.py +0 -0
  65. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/objects/core.py +0 -0
  66. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/objects/upsert.py +0 -0
  67. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/queries/__init__.py +0 -0
  68. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/queries/builder.py +0 -0
  69. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/queries/dialect.py +0 -0
  70. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/queries/executor.py +0 -0
  71. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/queryset.py +0 -0
  72. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/signals.py +0 -0
  73. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/utils/__init__.py +0 -0
  74. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/utils/inspect.py +0 -0
  75. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/utils/naming.py +0 -0
  76. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/utils/pattern.py +0 -0
  77. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects/validators.py +0 -0
  78. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/sqlobjects.egg-info/dependency_links.txt +0 -0
  79. {sqlobjects-1.0.12 → sqlobjects-1.0.14}/tests/test_config.py +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlobjects
3
- Version: 1.0.12
3
+ Version: 1.0.14
4
4
  Summary: Django-style async ORM library based on SQLAlchemy with chainable queries, Q objects, and relationship loading
5
5
  Author-email: XtraVisions <gitadmin@xtravisions.com>, Chen Hao <chenhao@xtravisions.com>
6
6
  Maintainer-email: XtraVisions <gitadmin@xtravisions.com>, Chen Hao <chenhao@xtravisions.com>
7
- License: MIT
7
+ License-Expression: MIT
8
8
  Project-URL: Homepage, https://github.com/XtraVisionsAI/sqlobjects
9
9
  Project-URL: Repository, https://github.com/XtraVisionsAI/sqlobjects.git
10
10
  Project-URL: Documentation, https://github.com/XtraVisionsAI/sqlobjects#readme
@@ -13,7 +13,6 @@ Project-URL: Changelog, https://github.com/XtraVisionsAI/sqlobjects/blob/main/CH
13
13
  Keywords: python,orm,async,django-style,database,query
14
14
  Classifier: Development Status :: 4 - Beta
15
15
  Classifier: Intended Audience :: Developers
16
- Classifier: License :: OSI Approved :: MIT License
17
16
  Classifier: Operating System :: OS Independent
18
17
  Classifier: Programming Language :: Python :: 3
19
18
  Classifier: Programming Language :: Python :: 3.12
@@ -25,7 +24,7 @@ Classifier: Typing :: Typed
25
24
  Requires-Python: >=3.12
26
25
  Description-Content-Type: text/markdown
27
26
  License-File: LICENSE
28
- Requires-Dist: sqlalchemy[asyncio]>=2.0.43
27
+ Requires-Dist: sqlalchemy[asyncio]>=2.0.44
29
28
  Dynamic: license-file
30
29
 
31
30
  # SQLObjects
@@ -1,9 +1,9 @@
1
1
  [project]
2
2
  name = "sqlobjects"
3
- version = "1.0.12"
3
+ version = "1.0.14"
4
4
  description = "Django-style async ORM library based on SQLAlchemy with chainable queries, Q objects, and relationship loading"
5
5
  readme = "README.md"
6
- license = { text = "MIT" }
6
+ license = "MIT"
7
7
  authors = [
8
8
  { name = "XtraVisions", email = "gitadmin@xtravisions.com" },
9
9
  { name = "Chen Hao", email = "chenhao@xtravisions.com" }
@@ -23,7 +23,6 @@ keywords = [
23
23
  classifiers = [
24
24
  "Development Status :: 4 - Beta",
25
25
  "Intended Audience :: Developers",
26
- "License :: OSI Approved :: MIT License",
27
26
  "Operating System :: OS Independent",
28
27
  "Programming Language :: Python :: 3",
29
28
  "Programming Language :: Python :: 3.12",
@@ -35,11 +34,11 @@ classifiers = [
35
34
  ]
36
35
  requires-python = ">=3.12"
37
36
  dependencies = [
38
- "sqlalchemy[asyncio]>=2.0.43",
37
+ "sqlalchemy[asyncio]>=2.0.44",
39
38
  ]
40
39
 
41
40
  [project.scripts]
42
- sqlobjects-install-rules = "scripts.install_rules:main"
41
+ sqlobjects-install-rules = "sqlobjects._install_rules:main"
43
42
 
44
43
  [project.urls]
45
44
  Homepage = "https://github.com/XtraVisionsAI/sqlobjects"
@@ -72,13 +71,13 @@ build-backend = "setuptools.build_meta"
72
71
  include-package-data = true
73
72
 
74
73
  [tool.setuptools.packages.find]
75
- include = ["sqlobjects*", "scripts*"]
74
+ include = ["sqlobjects*"]
76
75
 
77
76
  [tool.setuptools.package-data]
78
77
  sqlobjects = ["py.typed"]
79
78
 
80
79
  [tool.setuptools.data-files]
81
- "docs/rules" = ["docs/rules/*.md"]
80
+ "share/sqlobjects/rules" = ["docs/rules/*.md"]
82
81
 
83
82
  [[tool.uv.index]]
84
83
  name = "tsinghua"
@@ -0,0 +1,121 @@
1
+ """Install AI assistant rules to configuration directories."""
2
+
3
+ import shutil
4
+ import sys
5
+ from pathlib import Path
6
+
7
+
8
+ def find_project_root() -> Path:
9
+ """Find project root by looking for common markers."""
10
+ current = Path.cwd()
11
+ markers = [".git", "pyproject.toml", "setup.py", "package.json"]
12
+
13
+ # Search up to 5 levels
14
+ for _ in range(5):
15
+ if any((current / marker).exists() for marker in markers):
16
+ return current
17
+ if current.parent == current: # Reached filesystem root
18
+ break
19
+ current = current.parent
20
+
21
+ # Fallback to current directory
22
+ return Path.cwd()
23
+
24
+
25
+ def install_rules(target_name: str, target_dir: Path | None = None) -> bool:
26
+ """Install rules to AI assistant configuration directory.
27
+
28
+ Args:
29
+ target_name: Target AI assistant (amazonq, kiro, claude, cursor)
30
+ target_dir: Optional custom target directory (default: auto-detect project root)
31
+
32
+ Returns:
33
+ True if successful, False otherwise
34
+ """
35
+ # Try multiple locations for rules directory
36
+ possible_locations = [
37
+ # Location 1: Standard installation - share/sqlobjects/rules
38
+ Path(sys.prefix) / "share" / "sqlobjects" / "rules",
39
+ # Location 2: Development mode - project root
40
+ Path(__file__).parent.parent / "docs" / "rules",
41
+ ]
42
+
43
+ rules_dir = None
44
+ for location in possible_locations:
45
+ if location.exists() and list(location.glob("*.md")):
46
+ rules_dir = location
47
+ break
48
+
49
+ if not rules_dir:
50
+ print("Error: Rules directory not found in any of:", file=sys.stderr)
51
+ for loc in possible_locations:
52
+ print(f" - {loc}", file=sys.stderr)
53
+ return False
54
+
55
+ # Determine base directory
56
+ base_dir = target_dir if target_dir else find_project_root()
57
+
58
+ # Target directory mapping (project-level)
59
+ target_dirs = {
60
+ "amazonq": base_dir / ".amazonq" / "rules" / "sqlobjects",
61
+ "kiro": base_dir / ".kiro" / "rules" / "sqlobjects",
62
+ "claude": base_dir / ".claude" / "rules" / "sqlobjects",
63
+ "cursor": base_dir / ".cursor" / "rules" / "sqlobjects",
64
+ }
65
+
66
+ target_dir = target_dirs.get(target_name)
67
+ if not target_dir:
68
+ print(f"Error: Unknown target '{target_name}'", file=sys.stderr)
69
+ print(f"Valid targets: {', '.join(target_dirs.keys())}", file=sys.stderr)
70
+ return False
71
+
72
+ if not rules_dir.exists():
73
+ print(f"Error: Rules directory not found at {rules_dir}", file=sys.stderr)
74
+ return False
75
+
76
+ # Create target directory and copy files
77
+ try:
78
+ target_dir.mkdir(parents=True, exist_ok=True)
79
+
80
+ copied_count = 0
81
+ for file in rules_dir.glob("*.md"):
82
+ shutil.copy2(file, target_dir / file.name)
83
+ copied_count += 1
84
+
85
+ if copied_count > 0:
86
+ actual_target = target_dirs[target_name]
87
+ print(f"✓ Installed {copied_count} rule files to {actual_target}")
88
+ return True
89
+ else:
90
+ print("Warning: No rule files found to install", file=sys.stderr)
91
+ return False
92
+ except Exception as e:
93
+ print(f"Error: Failed to install rules: {e}", file=sys.stderr)
94
+ return False
95
+
96
+
97
+ def main():
98
+ """CLI entry point."""
99
+ if len(sys.argv) < 2:
100
+ print("Usage: sqlobjects-install-rules <target>")
101
+ print()
102
+ print("Install SQLObjects AI assistant rules to configuration directory.")
103
+ print()
104
+ print("Targets:")
105
+ print(" amazonq - Install to .amazonq/rules/sqlobjects/")
106
+ print(" cursor - Install to .cursor/rules/sqlobjects/")
107
+ print(" claude - Install to .claude/rules/sqlobjects/")
108
+ print(" kiro - Install to .kiro/rules/sqlobjects/")
109
+ print()
110
+ print("Examples:")
111
+ print(" sqlobjects-install-rules amazonq")
112
+ print(" sqlobjects-install-rules cursor")
113
+ sys.exit(1)
114
+
115
+ target = sys.argv[1].lower()
116
+ success = install_rules(target)
117
+ sys.exit(0 if success else 1)
118
+
119
+
120
+ if __name__ == "__main__":
121
+ main()
@@ -11,7 +11,7 @@ from .database.manager import get_database, get_default
11
11
  from .exceptions import convert_sqlalchemy_error
12
12
 
13
13
 
14
- __all__ = ["AsyncSession", "ctx_session", "ctx_sessions", "get_session"]
14
+ __all__ = ["AsyncSession", "ctx_session", "ctx_sessions", "get_session", "has_session"]
15
15
 
16
16
 
17
17
  # Explicit session management (highest priority)
@@ -347,3 +347,20 @@ def get_session(db_name: str | None = None, readonly: bool = True, auto_commit:
347
347
  - Create a new AsyncSession with specified parameters if no explicit session
348
348
  """
349
349
  return _SessionContextManager.get_session(db_name, readonly, auto_commit)
350
+
351
+
352
+ def has_session(db_name: str | None = None) -> bool:
353
+ """Check if an explicit session exists in current context.
354
+
355
+ Args:
356
+ db_name: Database name (uses default database if None)
357
+
358
+ Returns:
359
+ True if explicit session exists, False otherwise
360
+ """
361
+ name = db_name or get_default()
362
+ try:
363
+ explicit_sessions = _explicit_sessions.get({})
364
+ return name in explicit_sessions
365
+ except LookupError:
366
+ return False
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlobjects
3
- Version: 1.0.12
3
+ Version: 1.0.14
4
4
  Summary: Django-style async ORM library based on SQLAlchemy with chainable queries, Q objects, and relationship loading
5
5
  Author-email: XtraVisions <gitadmin@xtravisions.com>, Chen Hao <chenhao@xtravisions.com>
6
6
  Maintainer-email: XtraVisions <gitadmin@xtravisions.com>, Chen Hao <chenhao@xtravisions.com>
7
- License: MIT
7
+ License-Expression: MIT
8
8
  Project-URL: Homepage, https://github.com/XtraVisionsAI/sqlobjects
9
9
  Project-URL: Repository, https://github.com/XtraVisionsAI/sqlobjects.git
10
10
  Project-URL: Documentation, https://github.com/XtraVisionsAI/sqlobjects#readme
@@ -13,7 +13,6 @@ Project-URL: Changelog, https://github.com/XtraVisionsAI/sqlobjects/blob/main/CH
13
13
  Keywords: python,orm,async,django-style,database,query
14
14
  Classifier: Development Status :: 4 - Beta
15
15
  Classifier: Intended Audience :: Developers
16
- Classifier: License :: OSI Approved :: MIT License
17
16
  Classifier: Operating System :: OS Independent
18
17
  Classifier: Programming Language :: Python :: 3
19
18
  Classifier: Programming Language :: Python :: 3.12
@@ -25,7 +24,7 @@ Classifier: Typing :: Typed
25
24
  Requires-Python: >=3.12
26
25
  Description-Content-Type: text/markdown
27
26
  License-File: LICENSE
28
- Requires-Dist: sqlalchemy[asyncio]>=2.0.43
27
+ Requires-Dist: sqlalchemy[asyncio]>=2.0.44
29
28
  Dynamic: license-file
30
29
 
31
30
  # SQLObjects
@@ -1,8 +1,6 @@
1
- CHANGELOG.md
2
1
  LICENSE
3
2
  README.md
4
3
  pyproject.toml
5
- setup.py
6
4
  docs/rules/01-database-session-guide.md
7
5
  docs/rules/02-model-definition-guide.md
8
6
  docs/rules/03-query-operations-guide.md
@@ -11,9 +9,8 @@ docs/rules/05-relationships-guide.md
11
9
  docs/rules/06-validation-signals-guide.md
12
10
  docs/rules/07-performance-guide.md
13
11
  docs/rules/README.md
14
- scripts/__init__.py
15
- scripts/install_rules.py
16
12
  sqlobjects/__init__.py
13
+ sqlobjects/_install_rules.py
17
14
  sqlobjects/cascade.py
18
15
  sqlobjects/exceptions.py
19
16
  sqlobjects/metadata.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ sqlobjects-install-rules = sqlobjects._install_rules:main
@@ -0,0 +1 @@
1
+ sqlalchemy[asyncio]>=2.0.44
@@ -1,103 +0,0 @@
1
- ## 1.0.12 (2025-11-18)
2
-
3
- ### Refactor
4
-
5
- - move rules installer to independent scripts
6
-
7
- ## 1.0.11 (2025-11-18)
8
-
9
- ### Feat
10
-
11
- - add AI assistant rules with auto-install support
12
-
13
- ## 1.0.10 (2025-11-17)
14
-
15
- ### Feat
16
-
17
- - support Model class in join methods for cleaner API
18
-
19
- ## 1.0.9 (2025-11-14)
20
-
21
- ### Feat
22
-
23
- - add optional tables parameter to create_tables/drop_tables
24
-
25
- ## 1.0.8 (2025-11-11)
26
-
27
- ### Feat
28
-
29
- - add model-level relationship loading methods
30
- - improve relation field type inference
31
- - refactor relationship proxies
32
-
33
- ## 1.0.7 (2025-10-14)
34
-
35
- ### Feat
36
-
37
- - add upsert support for PostgreSQL
38
-
39
- ### Fix
40
-
41
- - identity support for PostgreSQL
42
-
43
- ### Refactor
44
-
45
- - consolidate bulk and queryset logic
46
-
47
- ### Perf
48
-
49
- - improve bulk delete performance
50
-
51
- ## 1.0.6 (2025-10-08)
52
-
53
- ### Feat
54
-
55
- - optimize field cache and state manager
56
- - implement relationship prefetch support
57
- - add kwargs parameter support to filter/exclude/get methods
58
-
59
- ### Refactor
60
-
61
- - unify cascade for model and queryset operations
62
-
63
- ## 1.0.5 (2025-09-25)
64
-
65
- ### Fix
66
-
67
- - generate DDL using column definition order
68
-
69
- ## 1.0.4 (2025-09-25)
70
-
71
- ### Feat
72
-
73
- - remove unnecessary exception catching
74
- - implement insert or update using database upsert
75
-
76
- ### Fix
77
-
78
- - use pk column name instead of column instance for pgsql upsert
79
-
80
- ### Refactor
81
-
82
- - move field default value related methods to DataConversionMixin
83
-
84
- ## 1.0.3 (2025-09-25)
85
-
86
- ### Fix
87
-
88
- - field default/default_factory not working
89
-
90
- ## 1.0.2 (2025-09-24)
91
-
92
- ### Feat
93
-
94
- - add type support for StringColumn
95
- - add support for cascade delete in relationships
96
- - add cascade support to relationship fields
97
- - add type checking for __registry__
98
- - use base model to create database tables
99
- - init public commit
100
-
101
- ### Fix
102
-
103
- - foreign key type inference issue
@@ -1 +0,0 @@
1
- """Scripts for SQLObjects package management."""
@@ -1,90 +0,0 @@
1
- """Install AI assistant rules to configuration directories."""
2
-
3
- import shutil
4
- import sys
5
- from pathlib import Path
6
-
7
-
8
- def install_rules(target_name: str) -> bool:
9
- """Install rules to AI assistant configuration directory.
10
-
11
- Args:
12
- target_name: Target AI assistant (amazonq, kiro, claude, cursor)
13
-
14
- Returns:
15
- True if successful, False otherwise
16
- """
17
- # Get rules directory from package installation
18
- try:
19
- # Find the package installation directory
20
- import sqlobjects
21
-
22
- package_root = Path(sqlobjects.__file__).parent.parent
23
- rules_dir = package_root / "docs" / "rules"
24
- except Exception as e:
25
- print(f"Error: Cannot locate sqlobjects package: {e}", file=sys.stderr)
26
- return False
27
-
28
- # Target directory mapping
29
- target_dirs = {
30
- "amazonq": Path.home() / ".amazonq" / "rules" / "sqlobjects",
31
- "kiro": Path.home() / ".kiro" / "rules" / "sqlobjects",
32
- "claude": Path.home() / ".claude" / "rules" / "sqlobjects",
33
- "cursor": Path.home() / ".cursor" / "rules" / "sqlobjects",
34
- }
35
-
36
- target_dir = target_dirs.get(target_name)
37
- if not target_dir:
38
- print(f"Error: Unknown target '{target_name}'", file=sys.stderr)
39
- print(f"Valid targets: {', '.join(target_dirs.keys())}", file=sys.stderr)
40
- return False
41
-
42
- if not rules_dir.exists():
43
- print(f"Error: Rules directory not found at {rules_dir}", file=sys.stderr)
44
- return False
45
-
46
- # Create target directory and copy files
47
- try:
48
- target_dir.mkdir(parents=True, exist_ok=True)
49
-
50
- copied_count = 0
51
- for file in rules_dir.glob("*.md"):
52
- shutil.copy2(file, target_dir / file.name)
53
- copied_count += 1
54
-
55
- if copied_count > 0:
56
- print(f"✓ Installed {copied_count} rule files to {target_dir}")
57
- return True
58
- else:
59
- print("Warning: No rule files found to install", file=sys.stderr)
60
- return False
61
- except Exception as e:
62
- print(f"Error: Failed to install rules: {e}", file=sys.stderr)
63
- return False
64
-
65
-
66
- def main():
67
- """CLI entry point."""
68
- if len(sys.argv) < 2:
69
- print("Usage: sqlobjects-install-rules <target>")
70
- print()
71
- print("Install SQLObjects AI assistant rules to configuration directory.")
72
- print()
73
- print("Targets:")
74
- print(" amazonq - Install to ~/.amazonq/rules/sqlobjects/")
75
- print(" cursor - Install to ~/.cursor/rules/sqlobjects/")
76
- print(" claude - Install to ~/.claude/rules/sqlobjects/")
77
- print(" kiro - Install to ~/.kiro/rules/sqlobjects/")
78
- print()
79
- print("Examples:")
80
- print(" sqlobjects-install-rules amazonq")
81
- print(" sqlobjects-install-rules cursor")
82
- sys.exit(1)
83
-
84
- target = sys.argv[1].lower()
85
- success = install_rules(target)
86
- sys.exit(0 if success else 1)
87
-
88
-
89
- if __name__ == "__main__":
90
- main()
@@ -1,7 +0,0 @@
1
- """Minimal setup.py for compatibility."""
2
-
3
- from setuptools import setup
4
-
5
-
6
- # All configuration is in pyproject.toml
7
- setup()
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- sqlobjects-install-rules = scripts.install_rules:main
@@ -1 +0,0 @@
1
- sqlalchemy[asyncio]>=2.0.43
File without changes
File without changes
File without changes