database-model-generator 0.6.0 → 0.6.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7a39c7334cf104518e8ecab58a57ea7baa2b34c4a12048b45b0df7d2cf56368
4
- data.tar.gz: 9bb0bd52e6de9ff30f54a609a5c96db968aac877cc00824ba789b3aa3c4eeff0
3
+ metadata.gz: 6be4d64e5f85a52ac4fd634f0a11f80c6ea8294065da9d258dd5e35084d31fd9
4
+ data.tar.gz: f1fc9410a6584615eac0d0bc11a298926eef3606589bb0bc48c624e80667ea75
5
5
  SHA512:
6
- metadata.gz: 15c94ddcedc209de09dad9c27f2655a2d163e3df51bdb21051526cbbe60b0effa8569eeb5168de27f11845ddf4b39a68927b985619eac53196e154867bc26d30
7
- data.tar.gz: 5fe097a00ba3151aa4ab21048b245ee26163e19e26daa2a05fd24131355bc296823d7e40a5040563797ae0722d9aa15505072bf1f1e611e555133d2295cb3668
6
+ metadata.gz: dffec8aa82468f6723f6c9984f7ff9b87328cdf5fe506380437f782d890300571983cdfe02be7fd5d64ec9d16e615df9813e8b3087704b5d75e8a7fe1aadcc1a
7
+ data.tar.gz: d5a64c260219b5010e312eb4604c8b09005cf2fd6e63325e5741e652c04cd1a29e944ecb42a35f314632b5571b6997a4982a309d3b30adb38b7eb9b28d2ed776
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.6.1 - 28-Jul-2025
2
+ * Added "datetime" field for validates_timeliness.
3
+ * Added validates_timeliness as a development dependency.
4
+
1
5
  ## 0.6.0 - 24-Jul-2025
2
6
  * Renamed from oracle-model-generator to database-model-generator.
3
7
  * Added enum support.
data/README.md CHANGED
@@ -9,7 +9,7 @@ use from the command line.
9
9
  ## Renamed
10
10
  Originally called "oracle-model-generator" and put into the dust bin, I've
11
11
  decided to revive this library with the help of AI. Specifically, I've added
12
- SQLServer support, and plan to Postgres support.
12
+ SQLServer support, and plan to add Postgres support.
13
13
 
14
14
  I also plan on lots of improvements, and some general refactoring.
15
15
 
@@ -23,8 +23,11 @@ Using the command line tool:
23
23
  `dmg -T sqlserver -s localhost -d your_database -t locations -u sa -p your_password`
24
24
 
25
25
  ### Auto-detection:
26
- `dmg -d your_database -t locations -u some_user -p some_password` # Oracle (default)
27
- `dmg -s localhost -d your_database -t locations -u sa -p password` # SQL Server (detected)
26
+ # Oracle (default)
27
+ `dmg -d your_database -t locations -u some_user -p some_password`
28
+
29
+ # SQL Server (detected)
30
+ `dmg -s localhost -d your_database -t locations -u sa -p password`
28
31
 
29
32
  The above command results in a file called "location.rb". This is an
30
33
  ActiveRecord model declaration, with all validations, primary keys,
data/bin/dmg CHANGED
@@ -404,7 +404,7 @@ File.open(ofile, 'w') do |fh|
404
404
  omg.column_info.each{ |col|
405
405
  data_type = col.data_type.to_s
406
406
 
407
- if ['date', 'time'].include?(data_type)
407
+ if ['date', 'time', 'datetime'].include?(data_type)
408
408
  if data_type == 'date'
409
409
  validation = "validates_date :#{col.name.downcase}"
410
410
  end
@@ -413,6 +413,10 @@ File.open(ofile, 'w') do |fh|
413
413
  validation = "validates_time :#{col.name.downcase}"
414
414
  end
415
415
 
416
+ if data_type == 'datetime'
417
+ validation = "validates_datetime :#{col.name.downcase}"
418
+ end
419
+
416
420
  unless header_printed
417
421
  fh.puts " # Requires the validates_timeliness library"
418
422
  end
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'database-model-generator'
5
- spec.version = '0.6.0'
5
+ spec.version = '0.6.1'
6
6
  spec.author = 'Daniel J. Berger'
7
7
  spec.license = 'Apache-2.0'
8
8
  spec.email = 'djberg96@gmail.com'
@@ -23,6 +23,10 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency('ruby-oci8', '~> 2.2')
24
24
  spec.add_development_dependency('tiny_tds', '~> 3.2.1')
25
25
 
26
+ # Again, I only set this as a development dependency mainly as a reminder.
27
+ # The version you need will depend on which version of Rails you're using.
28
+ spec.add_development_dependency('validates_timeliness')
29
+
26
30
  spec.description = <<-EOF
27
31
  The database-model-generator library allows you to generate an ActiveRecord
28
32
  model from an existing Oracle table or view, as well as automatically
@@ -13,7 +13,7 @@ end
13
13
  module DatabaseModel
14
14
  module Generator
15
15
  # The version of the database-model-generator library
16
- VERSION = '0.6.0'
16
+ VERSION = '0.6.1'
17
17
 
18
18
  # Factory method to create the appropriate generator based on connection type
19
19
  def self.new(connection, options = {})
@@ -9,7 +9,7 @@ RSpec.describe Oracle::Model::Generator do
9
9
 
10
10
  describe 'class information' do
11
11
  it 'has the correct version number' do
12
- expect(Oracle::Model::Generator::VERSION).to eq('0.5.0')
12
+ expect(Oracle::Model::Generator::VERSION).to eq('0.6.1')
13
13
  end
14
14
  end
15
15
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database-model-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -35,7 +35,7 @@ cert_chain:
35
35
  ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
36
36
  WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
37
37
  -----END CERTIFICATE-----
38
- date: 2025-07-24 00:00:00.000000000 Z
38
+ date: 2025-07-28 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: getopt
@@ -93,6 +93,20 @@ dependencies:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
95
  version: 3.2.1
96
+ - !ruby/object:Gem::Dependency
97
+ name: validates_timeliness
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
96
110
  description: |2
97
111
  The database-model-generator library allows you to generate an ActiveRecord
98
112
  model from an existing Oracle table or view, as well as automatically
metadata.gz.sig CHANGED
Binary file