salesforce-sql 0.3.0 → 0.4.0
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 +4 -4
- data/bin/sfsoql +12 -0
- data/features/misc.feature +11 -0
- data/features/support/env.rb +1 -0
- data/lib/salesforce/sql/app.rb +20 -10
- data/lib/salesforce/sql/cli.rb +10 -0
- data/lib/salesforce/sql/version.rb +1 -1
- metadata +12 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0784a2ff7c86fb3a91ea6d0db87ff7abefa0f9c9
|
4
|
+
data.tar.gz: 0e6331b40c877723e8f6dbf5ba3a970109772804
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c40d6c80f39164c897140649697a969eb767a9e2af43c7f8914f10fd11efef9d1df69e677df6365bfece29d90403d10f60c2b7431a1e7a3a1284b0bec421298a
|
7
|
+
data.tar.gz: c4aaa0804345d54439aedcb470d3875e6356634360390157b6cd522b64cddc9d3d12cf0a63274575d9d697ff99cfdd5fdf9bfb4d3b09fdf21658a59fd339721d
|
data/bin/sfsoql
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
@misc
|
2
|
+
Feature: Miscelaneous features
|
3
|
+
|
4
|
+
In order to use sfsoql command line application
|
5
|
+
As a salesforce developer
|
6
|
+
I want to be able to run sfsoql queries
|
7
|
+
|
8
|
+
Scenario: I should be able to check the version
|
9
|
+
When I run `sfsoql -v` interactively
|
10
|
+
Then the exit status should be 0
|
11
|
+
And the output should match /sfsoql \d+\.\d+.\d+/
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'aruba/cucumber'
|
data/lib/salesforce/sql/app.rb
CHANGED
@@ -6,6 +6,12 @@ module Salesforce
|
|
6
6
|
attr_accessor :username
|
7
7
|
attr_accessor :step
|
8
8
|
|
9
|
+
def sfbc
|
10
|
+
|
11
|
+
@salesforce_bulk_client
|
12
|
+
|
13
|
+
end
|
14
|
+
|
9
15
|
def initialize credentials
|
10
16
|
|
11
17
|
# Login credentials
|
@@ -30,6 +36,7 @@ module Salesforce
|
|
30
36
|
'LastModifiedById',
|
31
37
|
'SystemModstamp',
|
32
38
|
'LastActivityDate',
|
39
|
+
'IsPartner',
|
33
40
|
]
|
34
41
|
|
35
42
|
end
|
@@ -206,19 +213,16 @@ module Salesforce
|
|
206
213
|
count_after - count_before
|
207
214
|
end
|
208
215
|
|
209
|
-
private
|
210
216
|
|
211
217
|
def bulk_insert object, records
|
212
|
-
|
213
|
-
|
214
|
-
salesforce_bulk_job_status job
|
218
|
+
records.each do |record|
|
219
|
+
@restforce_client.create(object,record)
|
215
220
|
end
|
216
221
|
end
|
217
222
|
|
218
223
|
def bulk_delete object, records
|
219
|
-
|
220
|
-
|
221
|
-
salesforce_bulk_job_status job
|
224
|
+
records.each do |record|
|
225
|
+
@restforce_client.destroy(object,record['Id'])
|
222
226
|
end
|
223
227
|
end
|
224
228
|
|
@@ -249,7 +253,7 @@ module Salesforce
|
|
249
253
|
def restforce_rest_login credentials
|
250
254
|
grace = 0
|
251
255
|
begin
|
252
|
-
client = Restforce.new :host
|
256
|
+
client = Restforce.new :host => credentials[:host],
|
253
257
|
:username => credentials[:username],
|
254
258
|
:password => credentials[:password],
|
255
259
|
:client_id => credentials[:client_id],
|
@@ -264,12 +268,18 @@ module Salesforce
|
|
264
268
|
end
|
265
269
|
|
266
270
|
def salesforce_bulk_login user, pass, host
|
271
|
+
connection = nil
|
267
272
|
begin
|
268
|
-
|
269
|
-
|
273
|
+
if host.match(/login/)
|
274
|
+
connection = SalesforceBulk::Api.new(user,pass,false)
|
275
|
+
else
|
276
|
+
connection = SalesforceBulk::Api.new(user,pass,true)
|
277
|
+
end
|
270
278
|
rescue => e
|
271
279
|
puts "ERROR: Error trying to login bulk API using: #{user}, #{e}"
|
272
280
|
end
|
281
|
+
connection.query("Account", "select id, name, createddate from Account limit 3")
|
282
|
+
connection
|
273
283
|
end
|
274
284
|
|
275
285
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: salesforce-sql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Breinlinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,7 +97,8 @@ dependencies:
|
|
97
97
|
description: ''
|
98
98
|
email:
|
99
99
|
- "<juan.brein@breins.net>"
|
100
|
-
executables:
|
100
|
+
executables:
|
101
|
+
- sfsoql
|
101
102
|
extensions: []
|
102
103
|
extra_rdoc_files: []
|
103
104
|
files:
|
@@ -106,8 +107,12 @@ files:
|
|
106
107
|
- LICENSE.txt
|
107
108
|
- README.md
|
108
109
|
- Rakefile
|
110
|
+
- bin/sfsoql
|
111
|
+
- features/misc.feature
|
112
|
+
- features/support/env.rb
|
109
113
|
- lib/salesforce/sql.rb
|
110
114
|
- lib/salesforce/sql/app.rb
|
115
|
+
- lib/salesforce/sql/cli.rb
|
111
116
|
- lib/salesforce/sql/version.rb
|
112
117
|
- salesforce-sql.gemspec
|
113
118
|
homepage: ''
|
@@ -130,8 +135,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
135
|
version: '0'
|
131
136
|
requirements: []
|
132
137
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.
|
138
|
+
rubygems_version: 2.4.8
|
134
139
|
signing_key:
|
135
140
|
specification_version: 4
|
136
141
|
summary: ''
|
137
|
-
test_files:
|
142
|
+
test_files:
|
143
|
+
- features/misc.feature
|
144
|
+
- features/support/env.rb
|