Skip to content

Commit

Permalink
Update doc site
Browse files Browse the repository at this point in the history
  • Loading branch information
cchantep committed May 11, 2014
1 parent cb94033 commit 77611ac
Show file tree
Hide file tree
Showing 8 changed files with 1,010 additions and 962 deletions.
63 changes: 63 additions & 0 deletions build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Build

Acolyte can be built from these sources using SBT (0.12.2+): `sbt publish`

## Documentation

Documentation is generated using Maven 3: `mvn -f site.xml site`

## Deploy

To local repository:

```
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=jdbc-driver/target/jdbc-driver-$VERSION.pom -Dfile=jdbc-driver/target/jdbc-driver-$VERSION.jar -Durl=file://$REPOPATH
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=jdbc-scala/target/scala-2.10/jdbc-scala_2.10-$VERSION.pom -Dfile=jdbc-scala/target/scala-2.10/jdbc-scala_2.10-$VERSION.jar -Durl=file://$REPOPATH
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=scalac-plugin/target/scala-2.10/scalac-plugin_2.10-$VERSION.pom -Dfile=scalac-plugin/target/scala-2.10/scalac-plugin_2.10-$VERSION.jar -Durl=file://$REPOPATH
```

At Sonatype:

```
export REPO="https://oss.sonatype.org/service/local/staging/deploy/maven2/"
# or https://oss.sonatype.org/content/repositories/snapshots/
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=jdbc-driver/target/jdbc-driver-$VERSION.pom -Dfile=jdbc-driver/target/jdbc-driver-$VERSION.jar -Durl=$REPO -DrepositoryId=sonatype-nexus-staging
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=jdbc-driver/target/jdbc-driver-$VERSION.pom -Dfile=jdbc-driver/target/jdbc-driver-$VERSION-javadoc.jar -Dclassifier=javadoc -Durl=$REPO -DrepositoryId=sonatype-nexus-staging
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=jdbc-driver/target/jdbc-driver-$VERSION.pom -Dfile=jdbc-driver/target/jdbc-driver-$VERSION-sources.jar -Dclassifier=sources -Durl=$REPO -DrepositoryId=sonatype-nexus-staging
export SCALAVER="2.10"
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=jdbc-scala/target/scala-$SCALAVER/jdbc-scala_$SCALAVER-$VERSION.pom -Dfile=jdbc-scala/target/scala-$SCALAVER/jdbc-scala_$SCALAVER-$VERSION.jar -Durl=$REPO -DrepositoryId=sonatype-nexus-staging
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=jdbc-scala/target/scala-$SCALAVER/jdbc-scala_$SCALAVER-$VERSION.pom -Dfile=jdbc-scala/target/scala-$SCALAVER/jdbc-scala_$SCALAVER-$VERSION-javadoc.jar -Dclassifier=javadoc -Durl=$REPO -DrepositoryId=sonatype-nexus-staging
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=jdbc-scala/target/scala-$SCALAVER/jdbc-scala_$SCALAVER-$VERSION.pom -Dfile=jdbc-scala/target/scala-$SCALAVER/jdbc-scala_$SCALAVER-$VERSION-sources.jar -Dclassifier=sources -Durl=$REPO -DrepositoryId=sonatype-nexus-staging
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=scalac-plugin/target/scala-$SCALAVER/scalac-plugin_$SCALAVER-$VERSION.pom -Dfile=scalac-plugin/target/scala-$SCALAVER/scalac-plugin_$SCALAVER-$VERSION.jar -Durl=$REPO -DrepositoryId=sonatype-nexus-staging
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=scalac-plugin/target/scala-$SCALAVER/scalac-plugin_$SCALAVER-$VERSION.pom -Dfile=scalac-plugin/target/scala-$SCALAVER/scalac-plugin_$SCALAVER-$VERSION-javadoc.jar -Dclassifier=javadoc -Durl=$REPO -DrepositoryId=sonatype-nexus-staging
mvn gpg:sign-and-deploy-file -Dkeyname=$KEY -DpomFile=scalac-plugin/target/scala-$SCALAVER/scalac-plugin_$SCALAVER-$VERSION.pom -Dfile=scalac-plugin/target/scala-$SCALAVER/scalac-plugin_$SCALAVER-$VERSION-sources.jar -Dclassifier=sources -Durl=$REPO -DrepositoryId=sonatype-nexus-staging
```

Authentication should be configured in `~/.m2/settings.xml`:

```xml
<settings>
<servers>
<!-- ... -->

<server>
<id>sonatype-nexus-staging</id>
<username>your-jira-id</username>
<password>your-jira-pwd</password>
</server>
</servers>
<!-- ... -->
</settings>
```
11 changes: 4 additions & 7 deletions faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Why I need to specify a query detection pattern?

A database engine manages 2 kinds of statement, query statement that fetchs rows or updates statement that update persistent data.
JDBC manages 2 kinds of statement: query statement that fetchs rows, or updates statement that update persistent data.

To simulate this behaviour, to allow you return rows when you consider statement to be a query, or update state/count when it should be an update, Acolyte should be taught how to detect these cases.
To supports this behaviour, to return rows when you consider statement to be a query, or update state/count when it should be an update, Acolyte should be taught how to detect these cases.

Using composite handler, you can specify it using detection pattern(s) (regular expressions):

Expand All @@ -18,7 +18,7 @@ CompositeHandler handler = CompositeHandler.empty().
withQueryDetection(Pattern.compile("ORDER BY test$"));
```

In previous example, handler is given different patterns. In such case, order in which patterns were given is used to check executed statement, until it matches at least one of them, or they are all checked.
In previous example, handler is given different patterns. In such case, order in which patterns were given is used to check executed statement, until it matches at least one of them.

Equivalent with the Scala DSL is:

Expand Down Expand Up @@ -46,8 +46,6 @@ val handler = handleQuery { e: QueryExecution =>

Implementations of [Row](http://cchantep.github.io/acolyte/apidocs/acolyte/Row.html) and [RowList](http://cchantep.github.io/acolyte/apidocs/acolyte/RowList.html) are provided up to 52 columns.

As Scala tuples are limited to 22, syntax `rowList :+ tuple` is not available above this limit.

## How to simply return a single scalar row?

If you just need to mockup a result containing only 1 row with 1 column, single column factories (`booleanList`, `byteList`, `intList`, `stringList`, ...) can be called, or in Scala single value can be directly used (e.g. `2` for a single row with only one int column).
Expand Down Expand Up @@ -96,8 +94,7 @@ rowList6( // Now it's ok

## Why do I get error with null value in row?

As type can always be inferred when using `null`, it can lead to ambiguity.
e.g. error with the scala DSL:
As type can't always be inferred when using `null`, it can lead to ambiguity:

```
[error] found : Null(null)
Expand Down
Loading

0 comments on commit 77611ac

Please sign in to comment.