Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add search support for tags #9

Closed
5 tasks
masukomi opened this issue Oct 14, 2022 · 1 comment
Closed
5 tasks

add search support for tags #9

masukomi opened this issue Oct 14, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@masukomi
Copy link
Member

masukomi commented Oct 14, 2022

we should allow users to specify an array of tags in the TOML that can be used for searching.

  • add new tags table (id, tag)
  • add new commands_tags table (command_id, tag_id) compound key
  • add handling of the tags array (if present) to Ingester
    • tags table should update before command because of triggers on command tables
  • update the fts tables to have a tags column
  • update the triggers to have an insert that selects from commands & joins concatenated tags

example SQL (untested of 1 of the 3 triggers)
note that SQLite uses || instead of the traditional CONCAT function and GROUP_CONCAT for concatenating rows

CREATE TRIGGER commands_fts_update AFTER UPDATE ON commands
BEGIN
    INSERT INTO commands_fts
	(commands_fts, rowid, name, description, language, tags)
	VALUES ('delete', old.rowid, old.name, old.description, old.language);

    INSERT INTO commands_fts
	(rowid, name, description, language)
	(
            SELECT GROUP_CONCAT(tag) 
                from tags where  command_id = old.id
            );
END;
@masukomi masukomi added the enhancement New feature or request label Oct 14, 2022
@masukomi masukomi assigned masukomi and unassigned masukomi Oct 14, 2022
@masukomi masukomi added the good first issue Good for newcomers label Oct 14, 2022
@masukomi masukomi self-assigned this Oct 16, 2022
@masukomi masukomi removed the good first issue Good for newcomers label Oct 16, 2022
@masukomi
Copy link
Member Author

masukomi commented Nov 6, 2022

addressed in 1650dbf

will be released in v2

@masukomi masukomi closed this as completed Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant