Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Builder and RSpec matcher #9

Merged
merged 10 commits into from
Apr 28, 2016
Merged

Query Builder and RSpec matcher #9

merged 10 commits into from
Apr 28, 2016

Conversation

mknapik
Copy link
Contributor

@mknapik mknapik commented Apr 26, 2016

@mknapik mknapik force-pushed the feature/query_builder branch from 680ceb6 to 1bf72e4 Compare April 26, 2016 08:26
result = connection.fetch(query)

aggregate_failures do
names = result.map { |row| row[:name] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jekuta Use out new awesome matcher.

@wmiel
Copy link
Contributor

wmiel commented Apr 26, 2016

@mknapik @jekuta Looks really nice!


let(:schema) { subject.table_schema }

before { connection.execute(schema.create_table_statement) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the old way for this: before { connection.create_table(schema) }

@lauratpa lauratpa force-pushed the feature/query_builder branch from 2286eda to 94c1eae Compare April 27, 2016 06:45

def partition(hash)
partition_hash.merge!(hash)
self
Copy link
Contributor

@lauratpa lauratpa Apr 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mknapik Since we do work on an instance of the query, I changed the dup.tap { |builder| #do something with the copy } into making the change and returning self. This way we can still chain the methods as before, but we skip creating new objects every time a method is called.

@lauratpa lauratpa force-pushed the feature/query_builder branch from bdbf047 to b4a17b0 Compare April 27, 2016 08:28

before { connection.execute(schema.create_table_statement) }

context 'if we have a partition' do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mknapik I add a fast example on partition, but this could probably be more clear.

@lauratpa lauratpa force-pushed the feature/query_builder branch from 2a68e2c to ebff089 Compare April 28, 2016 07:44
mknapik and others added 5 commits April 28, 2016 11:54
* RuboCop fixes and .rubocop.yml adjustments
* make query_spec example prettier
* remove unused Rows
* Allow to inject row hashes with symbol and string keys
* immutable and mutable QueryBuilder
@mknapik mknapik force-pushed the feature/query_builder branch from 1768b89 to 470f69f Compare April 28, 2016 09:55
@mknapik mknapik merged commit 771c293 into master Apr 28, 2016
@mknapik mknapik deleted the feature/query_builder branch April 28, 2016 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants