Versions in this module Expand all Collapse all v0 v0.0.2 Jan 30, 2023 Changes in this version + const AssetsPlaceholder + const AttributesPlaceholder + const BlocksFTSCaseInsensitiveInsert + const BlocksFTSInsert + const BlocksInsert + const BlocksPlaceholder + const FileAnnotationRefsPlaceholder + const HistoriesFTSCaseInsensitiveInsert + const HistoriesPlaceholder + const RefsPlaceholder + const SpansInsert + const SpansPlaceholder + func AutoFlushTreeQueue() + func BeginHistoryTx() (tx *sql.Tx, err error) + func BeginTx() (tx *sql.Tx, err error) + func CacheRef(tree *parse.Tree, refNode *ast.Node) + func ClearBlockCache() + func ClearBoxHash(tx *sql.Tx) + func ClearQueue() + func ClearVirtualRefKeywords() + func CloseDatabase() + func CommitTx(tx *sql.Tx) (err error) + func DefRefs(condition string) (ret []map[*Block]*Block) + func DeleteAssetsByHashes(hashes []string) + func DeleteBlockByIDs(tx *sql.Tx, ids []string) (err error) + func DeleteByBoxTx(tx *sql.Tx, box string) (err error) + func DeleteByRootID(tx *sql.Tx, rootID string) (err error) + func DeleteHistoriesByPathPrefix(tx *sql.Tx, pathPrefix string) (err error) + func DeleteRefsByBoxTx(tx *sql.Tx, box string) (err error) + func DisableCache() + func EnableCache() + func GetBoxHash(box string) string + func GetContainerText(container *ast.Node) string + func GetDuplicatedRootIDs() (ret []string) + func GetRefText(defBlockID string) (ret string) + func GetRootUpdated() (ret map[string]string, err error) + func IndexMode() + func InitDatabase(forceRebuild bool) (err error) + func InitHistoryDatabase(forceRebuild bool) + func InsertBlock(tx *sql.Tx, block *Block, context map[string]interface{}) (err error) + func InsertBlocksSpans(tx *sql.Tx, tree *parse.Tree, context map[string]interface{}) (err error) + func InsertHistories(tx *sql.Tx, histories []*History) (err error) + func InsertRefs(tx *sql.Tx, tree *parse.Tree) + func IsBlockFolded(id string) (ret bool) + func IsEmptyQueue() bool + func NormalMode() + func PutBoxHash(tx *sql.Tx, box, hash string) + func Query(stmt string) (ret []map[string]interface{}, err error) + func QueryBlockAliases(rootID string) (ret []string) + func QueryBlockDefIDsByRefText(refText string, excludeIDs []string) (ret []string) + func QueryBlockNamesByRootID(rootID string) (ret []string) + func QueryBookmarkLabels() (ret []string) + func QueryChildDefIDsByRootDefID(rootDefID string) (ret []string) + func QueryHistory(stmt string) (ret []map[string]interface{}, err error) + func QueryRefIDsByAnnotationID(annotationID string) (refIDs, refTexts []string) + func QueryRefIDsByDefID(defID string, containChildren bool) (refIDs, refTexts []string) + func QueryRootBlockRefCount() (ret map[string]int) + func QueryRootChildrenRefCount(defRootID string) (ret map[string]int) + func QueryVirtualRefKeywords(name, alias, anchor, doc bool) (ret []string) + func RemoveBoxHash(tx *sql.Tx, box string) + func RemoveTreePathQueue(treeBox, treePathPrefix string) + func RemoveTreeQueue(box, rootID string) + func RenameTreeQueue(tree *parse.Tree, oldHPath string) + func RollbackTx(tx *sql.Tx) + func SetCaseSensitive(b bool) + func UpsertRefs(tx *sql.Tx, tree *parse.Tree) + func UpsertTreeQueue(tree *parse.Tree) + func WaitForWritingDatabase() + type Asset struct + BlockID string + Box string + DocPath string + Hash string + ID string + Name string + Path string + RootID string + Title string + func QueryAssetByHash(hash string) (ret *Asset) + func QueryRootBlockAssets(rootID string) (ret []*Asset) + type Attribute struct + BlockID string + Box string + ID string + Name string + Path string + RootID string + Type string + Value string + type Block struct + Alias string + Box string + Content string + Created string + FContent string + HPath string + Hash string + IAL string + ID string + Length int + Markdown string + Memo string + Name string + ParentID string + Path string + RootID string + Sort int + SubType string + Tag string + Type string + Updated string + func BuildBlockFromNode(n *ast.Node, tree *parse.Tree) (block *Block) + func GetAllChildBlocks(rootID, condition string) (ret []*Block) + func GetAllRootBlocks() (ret []*Block) + func GetBlock(id string) (ret *Block) + func GetBlocks(ids []string) (ret []*Block) + func GetChildBlocks(parentID, condition string) (ret []*Block) + func GetRefExistedBlocks() (ret []*Block) + func QueryBlockByNameOrAlias(rootID, text string) (ret *Block) + func QueryBookmarkBlocks() (ret []*Block) + func QueryBookmarkBlocksByKeyword(bookmark string) (ret []*Block) + func QueryDefRootBlocksByRefRootID(refRootID string) (ret []*Block) + func QueryRecentUpdatedBlocks() (ret []*Block) + func QueryRefRootBlocksByDefRootID(defRootID string) (ret []*Block) + func QueryRootBlockByCondition(condition string) (ret []*Block) + func SelectBlocksRawStmt(stmt string, limit int) (ret []*Block) + func SelectBlocksRawStmtNoParse(stmt string, limit int) (ret []*Block) + func (block *Block) IsContainerBlock() bool + type FileAnnotationRef struct + AnnotationID string + BlockID string + Box string + Content string + FilePath string + ID string + Path string + RootID string + Type string + type History struct + Content string + Created string + Op string + Path string + Title string + Type int + func SelectHistoriesRawStmt(stmt string) (ret []*History) + type Ref struct + BlockID string + Box string + Content string + DefBlockID string + DefBlockParentID string + DefBlockPath string + DefBlockRootID string + ID string + Markdown string + Path string + RootID string + Type string + func GetRefsCacheByDefID(defID string) (ret []*Ref) + func QueryRefsByDefID(defBlockID string, containChildren bool) (ret []*Ref) + func QueryRefsByDefIDRefID(defBlockID, refBlockID string) (ret []*Ref) + func QueryRefsRecent() (ret []*Ref) + type Span struct + BlockID string + Box string + Content string + IAL string + ID string + Markdown string + Path string + RootID string + Type string + func QueryTagSpans(p string, limit int) (ret []*Span) + func QueryTagSpansByKeyword(keyword string, limit int) (ret []*Span) + func SelectSpansRawStmt(stmt string, limit int) (ret []*Span) + type Stat struct + Key string + Val string