require "json" require_relative "../db" entities = DB[:entities] pinboard = DB[:pinboard] path = File.expand_path("~/Downloads/pinboard_export.2023.11.11_23.05.json_nd") File.foreach(path).with_index do |line, i| created_at = modified_at = DateTime.now json = line.chomp entity_id = entities.insert(created_at:, modified_at:) pinboard.insert(entity_id:, json: , created_at:, modified_at:) end