logica icon indicating copy to clipboard operation
logica copied to clipboard

Factor Out the Duplicate Lines

Open yilinxia opened this issue 2 years ago • 0 comments

Hi @EvgSkv ,

When working with Logica scripts across multiple cells, I've identified a potential enhancement (unless it's already implemented).

For comparison, in Jupyter, when executing an SQL query, I can simply use:

%%sql sqlite:///my_database.db

However, with Logica, transferring records from tables to predicates requires more steps:

%%logica Q1_Result
@Engine("sqlite");
@AttachDatabase("mydata", "my_database.db");
Emp(..r) :- mydata.Employee(..r);
Dep(..r) :- mydata.Department(..r);

Each time we execute a query in a different cell, these duplicates lines have to be re-written. Perhaps we can adopt a similar approach as with SQL.

yilinxia avatar Oct 20 '23 16:10 yilinxia