go-gorm / gorm

The fantastic ORM library for Golang, aims to be developer friendly
https://gorm.io
MIT License
37.08k stars 3.94k forks source link

Docs and Issues #348

Closed pedromorgan closed 9 years ago

pedromorgan commented 9 years ago

Am noticing a few common issues, and lack of docs..

Can help with the docs and issues as recent experience with revel..

-- issues -- we need to tag stuff, eg "driver", "interface", "query", "bug", et all, more than one.. some of these share a common themes.. example of tagging issues (although revel is alrge) https://github.com/revel/revel/issues

-- manual --

It doth not exist, so can I suggest I can work on that.. ?? we need to break it down into section etc.. Prefered is markdown and for markup.. although we do need a parser..

Maybe we can be clever and use openshift or alike.. ?? eg like http://revel-docs.daffodil.uk.com/manual/controllers.html

pedromorgan commented 9 years ago

gorm guide

Here is a quick guide to dive into gorm gorm = an golang flavoured object relational mapper = gorm

threre are a few other golang powered orms..

we are gorm ;-)

What is an Object Relational Mapper ?

Is GORm the best.. ? we dont claim to be, requirements and vastly different.. gorm is the simpler version of things, and across db and dialects..

Can I use my olde queies from php and cust and paste ? Yes, and the arguments. et all.. U can get an underlying connections to olde datbase..

Quick Start.. here were gonna connect to an exiting database.. and query its working and use automigrate to create some new columns.. and get an aggregate view..

This will make most php/python devs happy as they all code in hoardcore anyway...

pedromorgan commented 9 years ago

DB Connection

a Db connection exists within typically a web application..

pedromorgan commented 9 years ago

Raw SQL

Explain some show tables and stuff to get data from db.. execute a query to get last projects list and count aggregate.. ie test existing queries in golang and get rsults into print

Go Problems

pedromorgan commented 9 years ago

ORM and Automigrate

Defining tables with a struct.. CRUD

table naming shcema.. chaning schema named new cols are added.. index created..

using with session and and json/xml

pedromorgan commented 9 years ago

Query

Get a row query, and a view

Get a paged list query...

get an aggregate view

wojons commented 9 years ago

One issue i was having was trying to get more then one row back. When i was in debug mode it was allways returning one record. So for example.

var users User
db.Find(&users)

When if i wanted more than one record it needs to be

var users []User
db.Find(&users)

Dont get me wrong it makes perfect sense but for people new go to and trying to get going it gets a little confuessing.

jinzhu commented 9 years ago

Hi @pedromorgan

Just like what we contacted via email, what I want to have is more docs that follow godoc format, also it would be good to have a github page for it.

Thank you for would like to contribute the project.

wojons commented 9 years ago

@jinzhu

I think godoc's are great but getting started docs are just as important. they are super imporant for people that are still leraning the basics of go and need some help getting started.

pedromorgan commented 9 years ago

@wojons precicely ;-)

jinzhu commented 9 years ago

Hello @pedromorgan

Seems like you already using the WIKI for that, thank you ;)

Please feel free to update that, if it is good enough, we could use that to replace current README, or create new github page based on that.