sqlalchemy-risingwave 1.4.0__tar.gz → 1.4.1__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 (17) hide show
  1. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/PKG-INFO +3 -2
  2. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/sqlalchemy_risingwave/__init__.py +1 -1
  3. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/sqlalchemy_risingwave/base.py +19 -17
  4. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/sqlalchemy_risingwave.egg-info/PKG-INFO +3 -2
  5. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/LICENSE +0 -0
  6. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/README.md +0 -0
  7. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/setup.cfg +0 -0
  8. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/setup.py +0 -0
  9. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/sqlalchemy_risingwave/psycopg2.py +0 -0
  10. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/sqlalchemy_risingwave/requirements.py +0 -0
  11. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/sqlalchemy_risingwave.egg-info/SOURCES.txt +0 -0
  12. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/sqlalchemy_risingwave.egg-info/dependency_links.txt +0 -0
  13. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/sqlalchemy_risingwave.egg-info/entry_points.txt +0 -0
  14. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/sqlalchemy_risingwave.egg-info/not-zip-safe +0 -0
  15. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/sqlalchemy_risingwave.egg-info/requires.txt +0 -0
  16. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/sqlalchemy_risingwave.egg-info/top_level.txt +0 -0
  17. {sqlalchemy_risingwave-1.4.0 → sqlalchemy_risingwave-1.4.1}/test/test_schema.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: sqlalchemy-risingwave
3
- Version: 1.4.0
3
+ Version: 1.4.1
4
4
  Summary: RisingWave dialect for SQLAlchemy
5
5
  Home-page: https://github.com/risingwavelabs/risingwave
6
6
  Author: RisingWave Labs
@@ -28,6 +28,7 @@ Dynamic: description-content-type
28
28
  Dynamic: home-page
29
29
  Dynamic: keywords
30
30
  Dynamic: license
31
+ Dynamic: license-file
31
32
  Dynamic: project-url
32
33
  Dynamic: requires-dist
33
34
  Dynamic: summary
@@ -1,6 +1,6 @@
1
1
  from sqlalchemy.dialects import registry as _registry
2
2
 
3
- __version__ = "1.4.0"
3
+ __version__ = "1.4.1"
4
4
 
5
5
  _registry.register(
6
6
  "risingwave.psycopg2",
@@ -61,16 +61,18 @@ class RisingWaveDialect(PGDialect_psycopg2):
61
61
  def _get_server_version_info(self, conn):
62
62
  return (9, 5, 0)
63
63
 
64
- def get_table_names(self, conn, schema=None, **kw):
64
+ def get_table_names(self, connection, schema=None, **kw):
65
65
  sql = "SELECT tablename FROM pg_tables"
66
66
  if schema is not None:
67
67
  sql += f" WHERE schemaname = '{schema or self.default_schema_name}'"
68
68
  else:
69
69
  sql += " WHERE schemaname <> 'rw_catalog' and schemaname <> 'pg_catalog' and schemaname <> 'information_schema'"
70
- rows = conn.execute(text(sql))
70
+ rows = connection.execute(text(sql))
71
71
  return [row.tablename for row in rows]
72
72
 
73
- def get_view_names(self, conn, schema=None, include=("plain", "materialized"), **kw):
73
+ def get_view_names(
74
+ self, connection, schema=None, include=("plain", "materialized"), **kw
75
+ ):
74
76
  base_queries = [
75
77
  "SELECT viewname FROM pg_views",
76
78
  "SELECT matviewname as viewname FROM pg_matviews",
@@ -93,7 +95,7 @@ class RisingWaveDialect(PGDialect_psycopg2):
93
95
  else:
94
96
  sql += " WHERE schemaname <> 'rw_catalog' and schemaname <> 'pg_catalog' and schemaname <> 'information_schema'"
95
97
  queries.append(sql)
96
- views = conn.execute(text(" UNION ".join(queries)))
98
+ views = connection.execute(text(" UNION ".join(queries)))
97
99
 
98
100
  # As sqlalchmey has no support for Sources, we categorize as view temporarily.
99
101
  source_sql = f"SELECT rw_catalog.rw_sources.name as source_name FROM rw_catalog.rw_sources JOIN rw_catalog.rw_schemas ON rw_catalog.rw_sources.schema_id = rw_catalog.rw_schemas.id"
@@ -101,21 +103,21 @@ class RisingWaveDialect(PGDialect_psycopg2):
101
103
  source_sql += f" WHERE rw_catalog.rw_schemas.name = '{schema or self.default_schema_name}'"
102
104
  else:
103
105
  source_sql += " WHERE rw_catalog.rw_schemas.name <> 'rw_catalog' and rw_catalog.rw_schemas.name <> 'pg_catalog' and rw_catalog.rw_schemas.name <> 'information_schema'"
104
- sources = conn.execute(text(source_sql))
106
+ sources = connection.execute(text(source_sql))
105
107
 
106
108
  return [view.viewname for view in views] + [
107
109
  source.source_name for source in sources
108
110
  ]
109
111
 
110
- def has_table(self, conn, table, schema=None, **kw):
111
- return any(t == table for t in self.get_table_names(conn, schema=schema))
112
+ def has_table(self, connection, table, schema=None, **kw):
113
+ return any(t == table for t in self.get_table_names(connection, schema=schema))
112
114
 
113
- def get_columns(self, conn, table_name, schema=None, **kw):
115
+ def get_columns(self, connection, table_name, schema=None, **kw):
114
116
  sql = (
115
117
  "SELECT column_name, data_type FROM information_schema.columns WHERE "
116
118
  "table_schema = :table_schema AND table_name = :table_name"
117
119
  )
118
- rows = conn.execute(
120
+ rows = connection.execute(
119
121
  text(sql),
120
122
  {
121
123
  "table_schema": schema or self.default_schema_name,
@@ -162,7 +164,7 @@ class RisingWaveDialect(PGDialect_psycopg2):
162
164
  column_info = dict(
163
165
  name=name,
164
166
  type=type_class,
165
- nullable = True,
167
+ nullable=True,
166
168
  )
167
169
 
168
170
  res.append(column_info)
@@ -194,9 +196,9 @@ class RisingWaveDialect(PGDialect_psycopg2):
194
196
  raise exc.NoSuchTableError(table_name)
195
197
  return table_oid
196
198
 
197
- def get_indexes(self, conn, table_name, schema=None, **kw):
199
+ def get_indexes(self, connection, table_name, schema=None, **kw):
198
200
  table_oid = self.get_table_oid(
199
- conn, table_name, schema, info_cache=kw.get("info_cache")
201
+ connection, table_name, schema, info_cache=kw.get("info_cache")
200
202
  )
201
203
 
202
204
  sql = (
@@ -206,7 +208,7 @@ class RisingWaveDialect(PGDialect_psycopg2):
206
208
  "join pg_catalog.pg_attribute a on t.oid = a.attrelid and a.attnum = ANY(ix.indkey)"
207
209
  "where t.oid = :table_oid"
208
210
  )
209
- rows = conn.execute(
211
+ rows = connection.execute(
210
212
  text(sql),
211
213
  {"table_oid": table_oid},
212
214
  )
@@ -228,7 +230,7 @@ class RisingWaveDialect(PGDialect_psycopg2):
228
230
  )
229
231
  return res
230
232
 
231
- def get_foreign_keys_v1(self, conn, table_name, schema=None, **kw):
233
+ def get_foreign_keys_v1(self, connection, table_name, schema=None, **kw):
232
234
  return []
233
235
 
234
236
  def get_foreign_keys(
@@ -241,14 +243,14 @@ class RisingWaveDialect(PGDialect_psycopg2):
241
243
  ):
242
244
  return []
243
245
 
244
- def get_pk_constraint(self, conn, table_name, schema=None, **kw):
246
+ def get_pk_constraint(self, connection, table_name, schema=None, **kw):
245
247
  # TODO: Fill in real implementation to make get pk constraint work.
246
248
  return dict()
247
249
 
248
- def get_unique_constraints(self, conn, table_name, schema=None, **kw):
250
+ def get_unique_constraints(self, connection, table_name, schema=None, **kw):
249
251
  return []
250
252
 
251
- def get_check_constraints(self, conn, table_name, schema=None, **kw):
253
+ def get_check_constraints(self, connection, table_name, schema=None, **kw):
252
254
  return []
253
255
 
254
256
  def do_rollback_to_savepoint(self, connection, name):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: sqlalchemy-risingwave
3
- Version: 1.4.0
3
+ Version: 1.4.1
4
4
  Summary: RisingWave dialect for SQLAlchemy
5
5
  Home-page: https://github.com/risingwavelabs/risingwave
6
6
  Author: RisingWave Labs
@@ -28,6 +28,7 @@ Dynamic: description-content-type
28
28
  Dynamic: home-page
29
29
  Dynamic: keywords
30
30
  Dynamic: license
31
+ Dynamic: license-file
31
32
  Dynamic: project-url
32
33
  Dynamic: requires-dist
33
34
  Dynamic: summary