outworkers / sql-parser Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
.scalafmt
file with the configuration.sbt validate
command as part of the standard pull request runner. This will make the build fail if the formatting of modified code doesn't correspond to standards.To automatically publish the code to the Central Repository through the existing Outworkers integration, we need to:
publishSigned
command as part of the after_success
lifecycle.encrypted_key.asc
through Travis encrypted files, containing a signing only copy of the master Outworkers PGP key.sbt-sonatype
plugin to allow publishing to Maven Central automatically.sonatypeReleaseAll
command after publishing to the intermediary repository.Before the initial release is made, we need to cover the entire project with comprehensive tests. Make sure the reported code coverage on the few classes that we have is at least 80%.
Steps to complete this ticket:
sbt-coverage
plugin to the build pipelinesbt-coveralls
plugin for Coveralls.io integration.develop
branch until code coverage has been reported.testWithCoverage
command as part of the lifecycle.testWithCoverage
command on a specific Scala version(if building for multiple).When we bind prepared statements, we need tests and functionality to guarantee a thread safe initialisation. This is because re-preparing statements can cause a performance penalty and can interfere with the low level protocol.
To prevent this, we need a just time initialisation with the appropriate locking and testing, even if the mechanism is as simple as using lazy
before every bind definition.
The current problem is that unlike traditional JDBC, the postgres-async
driver doesn't seem to return full namespace and prefix metadata for SQL query results. This makes it difficult to parse results such as product.guid
vs stockorderitem.guid
or to specify the parsers using prefix namespaces at all.
We need a way to define parsers under a namespace, just like anorm allows. Example:
implicit val businessParser: PostgresRowParser[Business] = for {
id <- get[UUID]("business.guid")
urn <- get[UUID]("business.guid").map(BusinessURN.apply)
name <- get[String]("business.name")
} yield Business(id, urn, name)
Using this parser to extract results from an SQL ResultSet should be equivalent to using a parser definition without a namespace:
implicit val businessParser: PostgresRowParser[Business] = for {
id <- get[UUID]("guid")
urn <- get[UUID]("guid").map(BusinessURN.apply)
name <- get[String]("name")
} yield Business(id, urn, name)
However, in the case of joins, the parser should rely on the defined metadata to distinguish columns with the same name that belong to different tables. A ResultSet in the case of join can contain columns from multiple tables, and parsers should be able to automatically make use of them.
As we are using the shapeless library throughout the stack, there is no point re-defining basic HList operations using a new ~
operator which does the same thing. Replace the constructs to rely on HLists for tuple flattening and make the existing ~
operator simply be an equivalent of ::
on a shapeless.HList
.
After we remove the ~
operator we have inherited from Anorm in favour of shapeless.HList
, we can successfully remove the entire implementation of Tuple flatteners for the various arities, as they are nothing but Tupler.Aux
which already existing in Shapeless, which would allow us to convert an HList to a Tuple using macro derivation hidden away from us, instead of having to write a lot of boilerplat.e
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.