From 0286a6dca95b53af2327299ebaa49d0f590b78a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Matczuk?= Date: Mon, 24 Jul 2017 15:22:18 +0200 Subject: [PATCH] package doc --- doc.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 doc.go diff --git a/doc.go b/doc.go new file mode 100644 index 0000000..51483c3 --- /dev/null +++ b/doc.go @@ -0,0 +1,19 @@ +// Package gocqlx is a gocql extension, similar to what sqlx is to database/sql. +// +// It provides a new type that seamlessly wraps gocql.Iter and provide +// convenience methods which are useful in the development of database driven +// applications. None of the underlying gocql.Iter methods are changed. +// Instead all extended behavior is implemented through new methods defined on +// wrapper type. +// +// The wrapper type enables you to bind iterator row into a struct. Under the +// hood it uses sqlx/reflectx package, models / structs working whit sqlx will +// also work with gocqlx. +// +// Example, read all items for a given id +// +// var v []*Item +// if err := gocqlx.Select(session.Query(`SELECT * FROM items WHERE id = ?`, id), &v); err != nil { +// log.Fatal("select failed", err) +// } +package gocqlx