There is a component for storing data in memory with SQL query possible - ZMSQLhttps://wiki.freepascal.org/ZMSQL