Copy mapping SQL from gulls