From eb7b8d83ed7ce44af45b98d16fe0da4c41791f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Nieto?= <xiam@menteslibres.org> Date: Mon, 23 Jul 2012 19:13:38 -0500 Subject: [PATCH] Fixing docs --- README.md | 34 ++++++++-------------------------- db/README.md | 3 ++- db/mongo/README.md | 16 ++++++++++++++++ db/mysql/README.md | 16 ++++++++++++++++ db/sqlite/README.md | 27 +++++++++++++++++++++++---- 5 files changed, 65 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index ba79f2b8..9a246f9f 100644 --- a/README.md +++ b/README.md @@ -4,42 +4,24 @@ gosexy is a general purpose framework for Go that provides [sugar](http://en.wik ## Getting sexy -### Before pulling the source - -Make sure you have the ``git``, ``hg`` (mercurial) and ``bzr`` (bazaar) source control systems installed on your system, those packages are available for many linux distros and also in [homebrew](http://mxcl.github.com/homebrew/) for OSX. You'll also require ``sqlite3`` and ``pkg-config``. All those packages are required for building some third party dependencies. - -Here's how you would install them all on OSX using brew - - $ brew install git - $ brew install hg - $ brew install bzr - $ brew install sqlite3 - $ brew install pkg-config - -Or, let's suppose you want to bring them to ArchLinux - - # sudo pacman -S mercurial bzr sqlite3 git pkg-config - -### Using gosexy in your Go program - -First, get the source using ``go`` +In order to get sexy, you should pull the source $ go get github.com/xiam/gosexy -Then import ``gosexy`` into your actual source code +Then import ``gosexy`` into your program - import . "github.com/xiam/gosexy" + import "github.com/xiam/gosexy" ## Sugar wrappers -* [gosexy/db](https://github.com/xiam/gosexy/tree/master/db) - A wrapper of [database/sql](http://golang.org/pkg/database/sql), [mgo](http://launchpad.net/mgo) and friends for querying to MongoDB, MySQL, PostgreSQL or SQLite3 databases over a single, consistent interface. -* [gosexy/yaml](https://github.com/xiam/gosexy/tree/master/yaml) - A wrapper of [goyaml](http://launchpad.net/goyaml) for working with [YAML](http://www.yaml.org) formatted files. +* [gosexy/db](https://github.com/xiam/gosexy/tree/master/db) +* [gosexy/yaml](https://github.com/xiam/gosexy/tree/master/yaml) ## Sugar types -* ``Tuple`` is a shortcut for ``map[string]interface{}`` (generic dictionaries). -* ``List`` is a shortcut for ``[]interface{}`` (generic arrays). +* ``gosexy.Tuple`` is a shortcut for ``map[string]interface{}`` (generic dictionaries). +* ``gosexy.List`` is a shortcut for ``[]interface{}`` (generic arrays). ## License -gosexy and friends are all released under the terms of the [MIT License](https://raw.github.com/xiam/gosexy/master/LICENSE). +``gosexy`` and friends are all released under the terms of the [MIT License](https://raw.github.com/xiam/gosexy/master/LICENSE). diff --git a/db/README.md b/db/README.md index 7144f2ec..258ffb23 100644 --- a/db/README.md +++ b/db/README.md @@ -1,6 +1,6 @@ # gosexy/db -This package is a wrapper of many third party database drivers. The goal of this abstraction is to provide a common, simplified, consistent later for working with different databases without the need of SQL statements. +This package is a wrapper of many third party database drivers. The goal of this abstraction is to provide a common, simplified, consistent layer for working with different databases without the need of SQL statements. ## Installation @@ -254,4 +254,5 @@ Or you can [browse it](http://go.pkgdoc.org/github.com/xiam/gosexy/db) online. ## Changelog 2012/07/23 - Splitted databases wrapper into packages. Changed ``Where`` to ``Cond``. + 2012/07/09 - First public beta with MySQL, MongoDB, PostgreSQL and SQLite3. diff --git a/db/mongo/README.md b/db/mongo/README.md index 0eb33836..1d2f89f7 100644 --- a/db/mongo/README.md +++ b/db/mongo/README.md @@ -2,6 +2,22 @@ This driver is a wrapper of [mgo](http://labix.org/mgo) +## Requirements + +The [bazaar](http://bazaar.canonical.com/en/) version control system is required by ``mgo``. + +If you're using ``brew`` and OSX, you can install it like this + + $ brew install bzr + +On ArchLinux you could use + + $ sudo pacman -S bzr + +And on Debian based distros + + $ sudo aptitude install bzr + ## Installation $ go get github.com/xiam/gosexy/db/mongo diff --git a/db/mysql/README.md b/db/mysql/README.md index 3f5e9250..8118abf6 100644 --- a/db/mysql/README.md +++ b/db/mysql/README.md @@ -2,6 +2,22 @@ This driver is a wrapper of [go-mysql-driver](http://code.google.com/p/go-mysql-driver/) +## Requirements + +The [mercurial](http://mercurial.selenic.com/) version control system is required by ``go-mysql-driver``. + +If you're using ``brew`` and OSX, you can install it like this + + $ brew install hg + +On ArchLinux you could use + + $ sudo pacman -S mercurial + +And on Debian based distros + + $ sudo aptitude install mercurial + ## Installation $ go get github.com/xiam/gosexy/db/mysql diff --git a/db/sqlite/README.md b/db/sqlite/README.md index c98dd6f8..aecc3d88 100644 --- a/db/sqlite/README.md +++ b/db/sqlite/README.md @@ -1,21 +1,40 @@ -# gosexy/db/postgresql +# gosexy/db/sqlite This driver is a wrapper of [sqlite3](https://github.com/mattn/go-sqlite3). In order to work with ``gosexy/db`` the original driver had to be [forked](https://github.com/xiam/gosqlite3) as the changes made to it are incompatible with some of sqlite3's own features. +## Requirements + +The sqlite3 driver uses cgo, and it requires ``pkg-config`` and the sqlite3 header files in order to be installed. + +If you're using ``brew`` and OSX, you can install them like this + + $ brew install pkg-config + $ brew install sqlite3 + +On ArchLinux you could use + + $ sudo pacman -S pkg-config + $ sudo pacman -S sqlite3 + +And on Debian based distros + + $ sudo aptitude install pkg-config + $ sudo aptitude install libsqlite3-dev + ## Installation - $ go get github.com/xiam/gosexy/db/postgresql + $ go get github.com/xiam/gosexy/db/sqlite ## Usage import ( "github.com/xiam/gosexy/db" - "github.com/xiam/gosexy/db/postgresql" + "github.com/xiam/gosexy/db/sqlite" ) ## Connecting to a database - sess := postgresql.Session(db.DataSource{Host: "127.0.0.1"}) + sess := sqlite.Session(db.DataSource{Host: "127.0.0.1"}) err := sess.Open() defer sess.Close() -- GitLab