pg_conn 0.13.2 → 0.13.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a1eb7cce679245ec285129507e3d56948c2239b930ea18a757dd90c2e293404
4
- data.tar.gz: c60efa88bb84530b91a58fd296781052b500968010808f9fa2c3dca4873db772
3
+ metadata.gz: 57162c4e497d2a3146227e38dc53fc62401b64594f77ddb62f9e52696e351767
4
+ data.tar.gz: cef0246edde288bac0c4aa49cdf8f45b96d8d7831543725c58ed416a44cbde25
5
5
  SHA512:
6
- metadata.gz: de7cea3519b5dbd3763c24681ed917ae525fb87e359bc17461e0c950cc70ea47d3c79e230840d878a14533b7921a55384bf17235d32020787e22c37b8fb5e16c
7
- data.tar.gz: 6dde3d8a9ea145db3e28b2467df50333042f3243da9d7b741e1195bb2d17856577541ff8df09744cc94517f9e02c7e6de44eba52fb3ba0ca363d0103edc89d13
6
+ metadata.gz: f5839de957b29863938720f536b327e98c66f13fcf8c7e69b8d2909f47d801b33ae30f8690ba09fa5fdbb5144b6bb3d758addfb0b8c7dc0a89bafcd6af9d473d
7
+ data.tar.gz: aa5dc57e654267165b376168d8721cb34004ec0aeecf7efabf3547b96d4080ad49eaf5aff0f221b5d91a5dbf35e97b885b5b1e00f951cc02d65d82d281df0136
@@ -69,11 +69,12 @@ module PgConn
69
69
  end
70
70
 
71
71
  # Hollow-out a database by removing all schemas in the database. The public
72
- # schema is recreated afterwards unless if :public is false. Uses the current
73
- # database if @database is nil
72
+ # schema is recreated afterwards unless if :public is false. Uses the
73
+ # current database if @database is nil
74
74
  #
75
75
  # Note that the database can have active users logged in while the database
76
- # is emptied
76
+ # is emptied. TODO Explain what happens if the users have active
77
+ # transactions. Should the be terminated?
77
78
  #
78
79
  def empty!(database = nil, public: true, exclude: [])
79
80
  local = !database.nil?
@@ -86,7 +87,7 @@ module PgConn
86
87
  .join(", ")
87
88
  conn.exec "drop schema #{schemas} cascade"
88
89
 
89
- # FIXME SECURITY Why grant 'create' to public?
90
+ # FIXME FIXME FIXME SECURITY Why grant 'create' to public?
90
91
  conn.exec %(
91
92
  create schema public authorization postgres;
92
93
  grant usage, create on schema public to public
@@ -102,6 +103,7 @@ module PgConn
102
103
  create(to_database, owner: owner, template: from_database)
103
104
  end
104
105
 
106
+ # TODO: This code is replicated across many project. Should be moved to PgConn
105
107
  def load(database, file, role: ENV['USER'], gzip: nil)
106
108
  command_opt = role ? "-c \"set role #{role}\";\n" : nil
107
109
  if gzip
@@ -116,6 +118,7 @@ module PgConn
116
118
  status == 0 or raise PsqlError.new(stderr)
117
119
  end
118
120
 
121
+ # TODO: This code is replicated across many project. Should be moved to PgConn
119
122
  def save(database, file, data: true, schema: true, gzip: nil)
120
123
  data_opt = data ? nil : "--schema-only"
121
124
  schema_opt = schema ? nil : "--data-only"
@@ -1,3 +1,3 @@
1
1
  module PgConn
2
- VERSION = "0.13.2"
2
+ VERSION = "0.13.3"
3
3
  end
data/lib/pg_conn.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  require "pg"
2
2
  require 'ostruct'
3
3
 
4
- require "pg_conn/version"
5
- require "pg_conn/role_methods"
6
- require "pg_conn/schema_methods"
7
- require "pg_conn/rdbms_methods"
8
- require "pg_conn/session_methods"
4
+ require_relative "pg_conn/version"
5
+ require_relative "pg_conn/role_methods"
6
+ require_relative "pg_conn/schema_methods"
7
+ require_relative "pg_conn/rdbms_methods"
8
+ require_relative "pg_conn/session_methods"
9
9
 
10
10
  module PgConn
11
11
  class Error < StandardError; end
@@ -263,7 +263,7 @@ module PgConn
263
263
  # exist?(table, id)
264
264
  # eists?(table, where_clause)
265
265
  #
266
- # Return true iff the query returns exactly one value. Use '!empty?' to
266
+ # Return true iff the query returns exactly one record. Use '!empty?' to
267
267
  # check if the query returns one or more records
268
268
  def exist?(*args)
269
269
  arg1, arg2 = *args
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_conn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.2
4
+ version: 0.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-15 00:00:00.000000000 Z
11
+ date: 2024-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg