pry-sql 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -23
- data/lib/pry-sql.rb +2 -3
- data/lib/pry-sql/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 268282c423a113c7ce023984a61a00a702752c23
|
4
|
+
data.tar.gz: d8e4ea0f2207c3382cb5353ff2176137191a6ccc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ba0f40af8e2dd7072b1c790adf5a22c0a78f834e97ee1882aab667d1ba9f730f09df46123cbed6e40b2e64b80dc98e625dc0fc0dec41e296092665e67b717cf
|
7
|
+
data.tar.gz: dcd2756086848c334ff19acbef16f0bcae22fee51b936db086a74c0753a040d4a272c0ee439e42c6d63b724d13ba79934311ebc1964af41fb38ecee23a7e2624
|
data/README.md
CHANGED
@@ -1,34 +1,23 @@
|
|
1
1
|
# pry-sql
|
2
2
|
|
3
|
-
|
3
|
+
Execute SQL commands from the pry command line.
|
4
4
|
|
5
|
-
|
5
|
+
```
|
6
|
+
$ pry
|
7
|
+
[1] pry(main)> connect example.sqlite
|
8
|
+
[2] pry(main)> CREATE TABLE examples (text TEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP)
|
9
|
+
[3] pry(main)> INSERT INTO examples (text) VALUES ("Hello, worlds!")
|
10
|
+
[4] pry(main)> SELECT * FROM examples
|
11
|
+
=> [["Hello, worlds!", "2015-07-26 08:30:00"]]
|
12
|
+
```
|
6
13
|
|
7
14
|
## Installation
|
8
15
|
|
9
|
-
|
16
|
+
Install the gem globally or inside the :development group of your gemfile:
|
10
17
|
|
11
|
-
```ruby
|
12
|
-
gem 'pry-sql'
|
13
18
|
```
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install pry-sql
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
19
|
+
gem install 'pry-sql'
|
20
|
+
```
|
32
21
|
|
33
22
|
## Contributing
|
34
23
|
|
data/lib/pry-sql.rb
CHANGED
@@ -7,9 +7,8 @@ module PrySQL
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.connect(cmd, fname)
|
10
|
-
|
11
|
-
|
12
|
-
return
|
10
|
+
if fname != ':memory:' && !File.exist?(fname)
|
11
|
+
raise Pry::CommandError, "database file not found: #{fname}"
|
13
12
|
end
|
14
13
|
require "sqlite3"
|
15
14
|
@database = SQLite3::Database.new(fname)
|
data/lib/pry-sql/version.rb
CHANGED