boblail / hayfork Goto Github PK
View Code? Open in Web Editor NEWFull-Text search for ActiveRecord and Postgres
License: MIT License
Full-Text search for ActiveRecord and Postgres
License: MIT License
The README points out how a second foreach
block must be defined when working with associations; and that this is not adequate:
Hayfork.maintain(Haystack) do
foreach(Book) do
insert(:title)
insert(author: :name)
end
end
Instead, Hayfork could automatically define triggers based on insert(author: :name)
to watch authors and repopulate the haystack.
While implementing this technique, we should decide between two paths for how Hayfork handles has_many
associations. In the event that one of an article's comments is updated, we could either:
comments
entries for that post and regenerate all of themThe latter is how the README's example currently works; but combining the former strategy with #1 would also remove the need for a ref_id
column.
The README points out how field
must be added to get this example to work:
Hayfork.maintain(Haystack) do
foreach(Employee) do
insert(:full_name)
insert(:position)
insert(:short_bio)
end
end
Instead, Hayfork could entirely encapsulate its ability to delete the right rows from the haystack.
One option would be to add a statement_id
column to the haystack and to generate a unique ID for each statement (filename and line number?). This would also be useful for debugging since it would explain why a record is present in the haystack.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.