Documentation
¶
Index ¶
- Constants
- Variables
- func CreateBoard(title string, projectId int64) sql.Result
- func CreateCard(title string, boardId int64) sql.Result
- func CreateCardLabel(cardId int64, labelId int64) sql.Result
- func CreateCheckItem(title string, done int, cardId int64) sql.Result
- func CreateDBTables()
- func CreateLabel(title string, color string, projectId int64) sql.Result
- func CreateProject(title string) sql.Result
- func DBExists() bool
- func DeleteBoard(id int64)
- func DeleteCard(id int64)
- func DeleteCardLabel(labelId int64)
- func DeleteCheckItem(id int64)
- func DeleteLabel(id int64)
- func DeleteProject(id int64)
- func FromFile() []byte
- func OpenDB()
- func ToFile(data string)
- func UpdateBoardPosition(id int64, pos int) sql.Result
- func UpdateBoardTitle(id int64, title string) sql.Result
- func UpdateCardDesc(id int64, desc string) sql.Result
- func UpdateCardParent(id int64, boardId int64) sql.Result
- func UpdateCardTitle(id int64, title string) sql.Result
- func UpdateCheckItemDone(id int64, done int) sql.Result
- func UpdateCheckItemTitle(id int64, title string) sql.Result
- func UpdateLabelColor(id int64, color string) sql.Result
- func UpdateLabelTitle(id int64, title string) sql.Result
- func UpdateProject(id int64, title string) sql.Result
- type Board
- type BoardSql
- type Card
- type CardLabelSql
- type CardSql
- type CheckItem
- type CheckItemSql
- type Label
- type LabelSql
- type Menu
- type Project
- type ProjectSql
Constants ¶
View Source
const ( ErrCreatSQLstmt string = "Error creating SQL statement:" ErrExecSQLstmt string = "Error executing SQL statement:" ErrSQLrowScan string = "Error scanning rows:" )
View Source
const ( CreateTableProjects = ` CREATE TABLE IF NOT EXISTS projects ( id INTEGER PRIMARY KEY, title TEXT NOT NULL );` CreateTableBoards = `` /* 182-byte string literal not displayed */ CreateTableLabels = `` /* 185-byte string literal not displayed */ CreateTableCards = `` /* 175-byte string literal not displayed */ CreateTableCardLabels = `` /* 210-byte string literal not displayed */ CreateTableCheckItems = `` /* 186-byte string literal not displayed */ // queries // projects SelectAllProjectsSql = ` SELECT * FROM projects;` CreateProjectSql = ` INSERT INTO projects (title) VALUES ($1) RETURNING *;` UpdateProjectSql = ` UPDATE projects SET title = ?2 WHERE id = ?1 RETURNING *;` DeleteProjectSql = ` DELETE FROM projects WHERE id = ?1;` // boards SelectAllBoardsSql = ` SELECT * FROM boards;` SelectBoardsWithParentOrderedSql = ` SELECT * FROM boards WHERE project_id = ?1 ORDER BY position ASC;` CreateBoardSql = ` INSERT INTO boards (title, project_id) VALUES (?1, ?2) RETURNING *;` UpdateBoardTitleSql = ` UPDATE boards SET title = ?2 WHERE id = ?1 RETURNING *;` UpdateBoardPositionSql = ` UPDATE boards SET position = ?2 WHERE id = ?1 RETURNING *;` DeleteBoardSql = ` DELETE FROM boards WHERE id = ?1;` // labels SelectAllLabelsSql = ` SELECT * FROM labels;` SelectLabelsWithParentSql = ` SELECT * FROM labels WHERE project_id = ?1;` CreateLabelSql = ` INSERT INTO labels (title, color, project_id) VALUES ($1, $2, $3) RETURNING *;` UpdateLabelTitleSql = ` UPDATE labels SET title = ?2 WHERE id = ?1 RETURNING *;` UpdateLabelColorSql = ` UPDATE labels SET color = ?2 WHERE id = ?1 RETURNING *;` DeleteLabelSql = ` DELETE FROM labels WHERE id = ?1;` // cards SelectAllCardsSql = ` SELECT * FROM cards;` SelectCardsWithParentSql = ` SELECT * FROM cards WHERE board_id = ?1;` CreateCardSql = ` INSERT INTO cards (title, board_id) VALUES ($1, $2) RETURNING *;` UpdateCardTitleSql = ` UPDATE cards SET title = ?2 WHERE id = ?1 RETURNING *;` UpdateCardDescSql = ` UPDATE cards SET card_desc = ?2 WHERE id = ?1 RETURNING *;` UpdateCardParentSql = ` UPDATE cards SET board_id = ?2 WHERE id = ?1 RETURNING *;` DeleteCardSql = ` DELETE FROM cards WHERE id = ?1;` // card_labels SelectAllCardLabelsSql = ` SELECT * FROM card_labels;` SelectLabelsInCardSql = ` SELECT * FROM card_labels WHERE card_id = ?1;` CreateCardLabelSql = ` INSERT INTO card_labels (card_id, label_id) VALUES ($1, $2) RETURNING *;` DeleteCardLabelSql = ` DELETE FROM card_labels WHERE label_id = ?1;` // check_items SelectAllCheckItemsSql = ` SELECT * FROM check_items;` SelectCheckItemsWithParentSql = ` SELECT * FROM check_items WHERE card_id = ?1;` CreateCheckItemSql = ` INSERT INTO check_items (title, done, card_id) VALUES ($1, $2, $3) RETURNING *;` UpdateCheckItemTitleSql = ` UPDATE check_items SET title = ?2 WHERE id = ?1 RETURNING *;` UpdateCheckItemDoneSql = ` UPDATE check_items SET done = ?2 WHERE id = ?1 RETURNING *;` DeleteCheckItemSql = ` DELETE FROM check_items WHERE id = ?1;` )
Variables ¶
View Source
var DB *sql.DB
Functions ¶
func CreateDBTables ¶
func CreateDBTables()
func CreateProject ¶
func DeleteBoard ¶
func DeleteBoard(id int64)
func DeleteCard ¶
func DeleteCard(id int64)
func DeleteCardLabel ¶
func DeleteCardLabel(labelId int64)
func DeleteCheckItem ¶
func DeleteCheckItem(id int64)
func DeleteLabel ¶
func DeleteLabel(id int64)
func DeleteProject ¶
func DeleteProject(id int64)
Types ¶
type BoardSql ¶
boards
func GetAllBoards ¶
func GetAllBoards() []BoardSql
type CardLabelSql ¶
card_labels
func GetAllCardLabels ¶
func GetAllCardLabels() []CardLabelSql
func GetLabelsInCard ¶
func GetLabelsInCard(cardId int64) []CardLabelSql
type CardSql ¶
type CardSql struct {
Id int64
Title string
Desc sql.NullString
BoardId int64
}
cards
func GetAllCards ¶
func GetAllCards() []CardSql
func GetCardsWithParent ¶
type CheckItemSql ¶
check_items
func GetAllCheckItems ¶
func GetAllCheckItems() []CheckItemSql
func GetCheckItemsWithParent ¶
func GetCheckItemsWithParent(cardId int64) []CheckItemSql
type LabelSql ¶
labels
func GetAllLabels ¶
func GetAllLabels() []LabelSql
func GetLabelsWithParent ¶
Click to show internal directories.
Click to hide internal directories.