kura 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +6 -0
- data/lib/kura/client.rb +67 -0
- data/lib/kura/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74c035effdecfe9efbd8aac93065593f8250ad612f110d0aeef99e013209be27
|
4
|
+
data.tar.gz: 036f84aa09a18fc96668227d2c8379c8e404159e0da95994eaa7386ff5c235b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 434f0ed22b2b34c19ca6f296db7130da225ba9a7b141a6d4c6f4e3a80ff5d119bd0271daeafda023daf7fa15eefd32db519ae05cd27e26b82f6babc96f207a42
|
7
|
+
data.tar.gz: 5fa5947df8551de2399bb8e48228dee99d62d73a8b3a941f6341a8c80944b9cdda9a83ff8fb1f95371271f25287248eaf57660e985e785094ce0ef660857721e
|
data/ChangeLog.md
CHANGED
data/lib/kura/client.rb
CHANGED
@@ -737,5 +737,72 @@ module Kura
|
|
737
737
|
return nil if $!.respond_to?(:status_code) and $!.status_code == 404
|
738
738
|
process_error($!)
|
739
739
|
end
|
740
|
+
|
741
|
+
# Routines API
|
742
|
+
def routines(dataset_id, project_id: @default_project_id, limit: 1000, page_token: nil, &blk)
|
743
|
+
if blk
|
744
|
+
@api.list_routines(project_id, dataset_id, max_results: limit, page_token: page_token) do |result, err|
|
745
|
+
result &&= (result.routines || [])
|
746
|
+
blk.call(result, err)
|
747
|
+
end
|
748
|
+
else
|
749
|
+
@api.list_routines(project_id, dataset_id, max_results: limit, page_token: page_token)
|
750
|
+
end
|
751
|
+
rescue
|
752
|
+
process_error($!)
|
753
|
+
end
|
754
|
+
|
755
|
+
def routine(dataset_id, routine_id, project_id: @default_project_id, &blk)
|
756
|
+
if blk
|
757
|
+
@api.get_routine(project_id, dataset_id, routine_id) do |result, err|
|
758
|
+
if err.respond_to?(:status_code) and err.status_code == 404
|
759
|
+
result = nil
|
760
|
+
err = nil
|
761
|
+
end
|
762
|
+
blk.call(result, err)
|
763
|
+
end
|
764
|
+
else
|
765
|
+
@api.get_routine(project_id, dataset_id, routine_id)
|
766
|
+
end
|
767
|
+
rescue
|
768
|
+
return nil if $!.respond_to?(:status_code) and $!.status_code == 404
|
769
|
+
process_error($!)
|
770
|
+
end
|
771
|
+
|
772
|
+
def delete_routine(dataset_id, routine_id, project_id: @default_project_id, &blk)
|
773
|
+
@api.delete_routine(project_id, dataset_id, routine_id, &blk)
|
774
|
+
rescue
|
775
|
+
return nil if $!.respond_to?(:status_code) and $!.status_code == 404
|
776
|
+
process_error($!)
|
777
|
+
end
|
778
|
+
|
779
|
+
def insert_routine(dataset_id,
|
780
|
+
routine_id,
|
781
|
+
body,
|
782
|
+
project_id: @default_project_id,
|
783
|
+
routine_type: "PROCEDURE",
|
784
|
+
language: "SQL",
|
785
|
+
arguments: [],
|
786
|
+
return_type: nil,
|
787
|
+
imported_libraries: [],
|
788
|
+
description: nil)
|
789
|
+
@api.insert_routine(
|
790
|
+
project_id,
|
791
|
+
dataset_id,
|
792
|
+
Google::Apis::BigqueryV2::Routine.new(
|
793
|
+
routine_reference: Google::Apis::BigqueryV2::RoutineReference.new(
|
794
|
+
project_id: project_id,
|
795
|
+
dataset_id: dataset_id,
|
796
|
+
routine_id: routine_id
|
797
|
+
),
|
798
|
+
arguments: arguments,
|
799
|
+
definition_body: body,
|
800
|
+
imported_libraries: imported_libraries,
|
801
|
+
language: language,
|
802
|
+
return_type: return_type,
|
803
|
+
routine_type: routine_type,
|
804
|
+
description: description
|
805
|
+
))
|
806
|
+
end
|
740
807
|
end
|
741
808
|
end
|
data/lib/kura/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kura
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chikanaga Tomoyuki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-api-client
|