Fluent APIs in Julia

I don’t think its possible to have .select

But it seems like you need to be very clear if you are making a macro-based DSL or using pure julia. Because the approach and syntax could be totally different. If your using a custom macro, you seem to be leaning to a DSL. So you may as well make it really clean syntax or its kind of a waste of using a macro.

So you don’t need the @with QueryBuilder part or the + or anything, just add them with the macro. You could swap the dots for spaces to use args in the macro, and you wont even have to parse much AST. Otherwise maybe don’t use a macro, its not worth the confusion and weirdness…

macro qb(args...)
       do_your_things(args)
end

@qb select(...) from(...) where(...) limit(...)