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

Support default values #312

Merged
merged 5 commits into from
Jan 7, 2019
Merged

Conversation

Blacksmoke16
Copy link
Contributor

@Blacksmoke16 Blacksmoke16 commented Jan 6, 2019

Adds the ability to define default values. Changes #quote to use String.build vs #gsub and +.

         quote   9.23M (108.35ns) (± 3.16%)  256 B/op   1.60× slower
string builder   14.8M ( 67.58ns) (± 1.12%)  208 B/op        fastest

Optimize #quote
@@ -82,12 +82,15 @@ abstract class Granite::Adapter::Base
macro inherited
# quotes table and column names
def quote(name : String) : String
char = QUOTING_CHAR
char + name.gsub(char, "#{char}#{char}") + char
String.build do |str|
Copy link
Member

Choose a reason for hiding this comment

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

💯 good idea!

@drujensen drujensen merged commit c441e5f into amberframework:master Jan 7, 2019
@Blacksmoke16 Blacksmoke16 deleted the default-values branch January 7, 2019 02:36
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.

2 participants