code: func (adapter *SQLiteAdapter) LastBlockIDQuery() string {
  	query := `
  		WITH ll AS (
  			SELECT MAX(%s) AS %s FROM %s
  		)
  		SELECT COALESCE(%s, '0') AS %s
  			FROM ll LEFT OUTER JOIN %s log ON (ll.%s = log.%s);`
  
  	return Cleanf(query,
  		types.SQLColumnLabelId,                         // max
  		types.SQLColumnLabelId,                         // as
  		types.SQLLogTableName,                          // from
  		types.SQLColumnLabelHeight,                     // coalesce
  		types.SQLColumnLabelHeight,                     // as
  		types.SQLLogTableName,                          // from
  		types.SQLColumnLabelId, types.SQLColumnLabelId) // on
  }
docs: // LastBlockIDQuery returns a query for last inserted blockId in log table