├── internal └── dbtest │ ├── .gitignore │ ├── doc.go │ ├── testdata │ └── snapshots │ │ ├── TestQuery-pg-7 │ │ ├── TestQuery-pgx-7 │ │ ├── TestQuery-mariadb-7 │ │ ├── TestQuery-mysql5-7 │ │ ├── TestQuery-mysql8-7 │ │ ├── TestQuery-sqlite-7 │ │ ├── TestQuery-mssql2019-7 │ │ ├── TestQuery-pg-9 │ │ ├── TestQuery-mariadb-9 │ │ ├── TestQuery-mysql5-34 │ │ ├── TestQuery-mysql5-9 │ │ ├── TestQuery-mysql8-34 │ │ ├── TestQuery-mysql8-9 │ │ ├── TestQuery-pg-180 │ │ ├── TestQuery-pg-34 │ │ ├── TestQuery-pg-8 │ │ ├── TestQuery-pgx-180 │ │ ├── TestQuery-pgx-34 │ │ ├── TestQuery-pgx-8 │ │ ├── TestQuery-pgx-9 │ │ ├── TestQuery-sqlite-0 │ │ ├── TestQuery-sqlite-34 │ │ ├── TestQuery-sqlite-9 │ │ ├── TestQuery-mariadb-0 │ │ ├── TestQuery-mariadb-180 │ │ ├── TestQuery-mariadb-34 │ │ ├── TestQuery-mariadb-45 │ │ ├── TestQuery-mariadb-8 │ │ ├── TestQuery-mssql2019-0 │ │ ├── TestQuery-mssql2019-180 │ │ ├── TestQuery-mssql2019-34 │ │ ├── TestQuery-mssql2019-45 │ │ ├── TestQuery-mssql2019-8 │ │ ├── TestQuery-mssql2019-9 │ │ ├── TestQuery-mysql5-0 │ │ ├── TestQuery-mysql5-180 │ │ ├── TestQuery-mysql5-45 │ │ ├── TestQuery-mysql5-8 │ │ ├── TestQuery-mysql8-0 │ │ ├── TestQuery-mysql8-180 │ │ ├── TestQuery-mysql8-45 │ │ ├── TestQuery-mysql8-8 │ │ ├── TestQuery-sqlite-180 │ │ ├── TestQuery-sqlite-45 │ │ ├── TestQuery-sqlite-8 │ │ ├── TestQuery-pg-157 │ │ ├── TestQuery-pg-177 │ │ ├── TestQuery-pg-183 │ │ ├── TestQuery-pg-40 │ │ ├── TestQuery-pg-78 │ │ ├── TestQuery-pgx-183 │ │ ├── TestQuery-pgx-40 │ │ ├── TestQuery-pgx-78 │ │ ├── TestQuery-mariadb-157 │ │ ├── TestQuery-mariadb-177 │ │ ├── TestQuery-mariadb-183 │ │ ├── TestQuery-mariadb-40 │ │ ├── TestQuery-mariadb-78 │ │ ├── TestQuery-mssql2019-183 │ │ ├── TestQuery-mssql2019-78 │ │ ├── TestQuery-mysql5-157 │ │ ├── TestQuery-mysql5-177 │ │ ├── TestQuery-mysql5-183 │ │ ├── TestQuery-mysql5-186 │ │ ├── TestQuery-mysql5-40 │ │ ├── TestQuery-mysql5-73 │ │ ├── TestQuery-mysql5-78 │ │ ├── TestQuery-mysql8-157 │ │ ├── TestQuery-mysql8-177 │ │ ├── TestQuery-mysql8-183 │ │ ├── TestQuery-mysql8-186 │ │ ├── TestQuery-mysql8-40 │ │ ├── TestQuery-mysql8-73 │ │ ├── TestQuery-mysql8-78 │ │ ├── TestQuery-pg-0 │ │ ├── TestQuery-pg-131 │ │ ├── TestQuery-pg-136 │ │ ├── TestQuery-pg-141 │ │ ├── TestQuery-pg-149 │ │ ├── TestQuery-pg-158 │ │ ├── TestQuery-pg-3 │ │ ├── TestQuery-pg-44 │ │ ├── TestQuery-pg-73 │ │ ├── TestQuery-pg-74 │ │ ├── TestQuery-pg-85 │ │ ├── TestQuery-pgx-0 │ │ ├── TestQuery-pgx-131 │ │ ├── TestQuery-pgx-136 │ │ ├── TestQuery-pgx-141 │ │ ├── TestQuery-pgx-149 │ │ ├── TestQuery-pgx-157 │ │ ├── TestQuery-pgx-158 │ │ ├── TestQuery-pgx-177 │ │ ├── TestQuery-pgx-3 │ │ ├── TestQuery-pgx-73 │ │ ├── TestQuery-sqlite-1 │ │ ├── TestQuery-sqlite-157 │ │ ├── TestQuery-sqlite-177 │ │ ├── TestQuery-sqlite-183 │ │ ├── TestQuery-sqlite-184 │ │ ├── TestQuery-sqlite-186 │ │ ├── TestQuery-sqlite-40 │ │ ├── TestQuery-sqlite-73 │ │ ├── TestQuery-sqlite-78 │ │ ├── TestAlterTable-pg-drop_table │ │ ├── TestAlterTable-pgx-drop_table │ │ ├── TestQuery-mariadb-125 │ │ ├── TestQuery-mariadb-126 │ │ ├── TestQuery-mariadb-158 │ │ ├── TestQuery-mariadb-184 │ │ ├── TestQuery-mariadb-186 │ │ ├── TestQuery-mariadb-3 │ │ ├── TestQuery-mariadb-44 │ │ ├── TestQuery-mariadb-73 │ │ ├── TestQuery-mariadb-74 │ │ ├── TestQuery-mariadb-76 │ │ ├── TestQuery-mariadb-85 │ │ ├── TestQuery-mssql2019-1 │ │ ├── TestQuery-mssql2019-157 │ │ ├── TestQuery-mssql2019-158 │ │ ├── TestQuery-mssql2019-177 │ │ ├── TestQuery-mssql2019-184 │ │ ├── TestQuery-mssql2019-186 │ │ ├── TestQuery-mssql2019-3 │ │ ├── TestQuery-mssql2019-40 │ │ ├── TestQuery-mssql2019-73 │ │ ├── TestQuery-mssql2019-76 │ │ ├── TestQuery-mysql5-125 │ │ ├── TestQuery-mysql5-126 │ │ ├── TestQuery-mysql5-158 │ │ ├── TestQuery-mysql5-184 │ │ ├── TestQuery-mysql5-3 │ │ ├── TestQuery-mysql5-44 │ │ ├── TestQuery-mysql5-50 │ │ ├── TestQuery-mysql5-74 │ │ ├── TestQuery-mysql5-76 │ │ ├── TestQuery-mysql5-85 │ │ ├── TestQuery-mysql8-158 │ │ ├── TestQuery-mysql8-184 │ │ ├── TestQuery-mysql8-3 │ │ ├── TestQuery-mysql8-44 │ │ ├── TestQuery-mysql8-50 │ │ ├── TestQuery-mysql8-74 │ │ ├── TestQuery-mysql8-85 │ │ ├── TestQuery-pg-4 │ │ ├── TestQuery-pg-42 │ │ ├── TestQuery-pg-45 │ │ ├── TestQuery-pg-5 │ │ ├── TestQuery-pg-50 │ │ ├── TestQuery-pg-58 │ │ ├── TestQuery-pgx-44 │ │ ├── TestQuery-pgx-45 │ │ ├── TestQuery-pgx-5 │ │ ├── TestQuery-pgx-50 │ │ ├── TestQuery-pgx-58 │ │ ├── TestQuery-pgx-74 │ │ ├── TestQuery-pgx-85 │ │ ├── TestQuery-sqlite-131 │ │ ├── TestQuery-sqlite-136 │ │ ├── TestQuery-sqlite-141 │ │ ├── TestQuery-sqlite-149 │ │ ├── TestQuery-sqlite-158 │ │ ├── TestQuery-sqlite-3 │ │ ├── TestQuery-sqlite-44 │ │ ├── TestQuery-sqlite-50 │ │ ├── TestQuery-sqlite-74 │ │ ├── TestQuery-sqlite-85 │ │ ├── TestQuery-mariadb-1 │ │ ├── TestQuery-mariadb-31 │ │ ├── TestQuery-mariadb-4 │ │ ├── TestQuery-mariadb-42 │ │ ├── TestQuery-mariadb-5 │ │ ├── TestQuery-mariadb-50 │ │ ├── TestQuery-mariadb-58 │ │ ├── TestQuery-mssql2019-125 │ │ ├── TestQuery-mssql2019-126 │ │ ├── TestQuery-mssql2019-131 │ │ ├── TestQuery-mssql2019-136 │ │ ├── TestQuery-mssql2019-141 │ │ ├── TestQuery-mssql2019-149 │ │ ├── TestQuery-mssql2019-31 │ │ ├── TestQuery-mssql2019-44 │ │ ├── TestQuery-mssql2019-50 │ │ ├── TestQuery-mssql2019-61 │ │ ├── TestQuery-mssql2019-74 │ │ ├── TestQuery-mssql2019-85 │ │ ├── TestQuery-mssql2019-96 │ │ ├── TestQuery-mysql5-1 │ │ ├── TestQuery-mysql5-31 │ │ ├── TestQuery-mysql5-4 │ │ ├── TestQuery-mysql5-42 │ │ ├── TestQuery-mysql5-5 │ │ ├── TestQuery-mysql5-58 │ │ ├── TestQuery-mysql5-61 │ │ ├── TestQuery-mysql8-1 │ │ ├── TestQuery-mysql8-4 │ │ ├── TestQuery-mysql8-42 │ │ ├── TestQuery-mysql8-5 │ │ ├── TestQuery-mysql8-58 │ │ ├── TestQuery-mysql8-61 │ │ ├── TestQuery-pg-105 │ │ ├── TestQuery-pg-111 │ │ ├── TestQuery-pg-125 │ │ ├── TestQuery-pg-126 │ │ ├── TestQuery-pg-167 │ │ ├── TestQuery-pg-186 │ │ ├── TestQuery-pg-36 │ │ ├── TestQuery-pg-41 │ │ ├── TestQuery-pg-76 │ │ ├── TestQuery-pgx-105 │ │ ├── TestQuery-pgx-111 │ │ ├── TestQuery-pgx-167 │ │ ├── TestQuery-pgx-36 │ │ ├── TestQuery-pgx-4 │ │ ├── TestQuery-pgx-41 │ │ ├── TestQuery-pgx-42 │ │ ├── TestQuery-pgx-76 │ │ ├── TestQuery-sqlite-4 │ │ ├── TestQuery-sqlite-42 │ │ ├── TestQuery-sqlite-5 │ │ ├── TestQuery-sqlite-58 │ │ ├── TestQuery-sqlite-61 │ │ ├── TestQuery-sqlite-96 │ │ ├── TestQuery-mariadb-105 │ │ ├── TestQuery-mariadb-111 │ │ ├── TestQuery-mariadb-154 │ │ ├── TestQuery-mariadb-155 │ │ ├── TestQuery-mariadb-167 │ │ ├── TestQuery-mariadb-179 │ │ ├── TestQuery-mariadb-193 │ │ ├── TestQuery-mariadb-36 │ │ ├── TestQuery-mariadb-41 │ │ ├── TestQuery-mariadb-61 │ │ ├── TestQuery-mariadb-65 │ │ ├── TestQuery-mariadb-91 │ │ ├── TestQuery-mssql2019-105 │ │ ├── TestQuery-mssql2019-106 │ │ ├── TestQuery-mssql2019-111 │ │ ├── TestQuery-mssql2019-167 │ │ ├── TestQuery-mssql2019-36 │ │ ├── TestQuery-mssql2019-4 │ │ ├── TestQuery-mssql2019-42 │ │ ├── TestQuery-mssql2019-5 │ │ ├── TestQuery-mssql2019-58 │ │ ├── TestQuery-mssql2019-59 │ │ ├── TestQuery-mssql2019-65 │ │ ├── TestQuery-mssql2019-91 │ │ ├── TestQuery-mysql5-105 │ │ ├── TestQuery-mysql5-106 │ │ ├── TestQuery-mysql5-109 │ │ ├── TestQuery-mysql5-111 │ │ ├── TestQuery-mysql5-154 │ │ ├── TestQuery-mysql5-155 │ │ ├── TestQuery-mysql5-167 │ │ ├── TestQuery-mysql5-179 │ │ ├── TestQuery-mysql5-193 │ │ ├── TestQuery-mysql5-36 │ │ ├── TestQuery-mysql5-41 │ │ ├── TestQuery-mysql5-43 │ │ ├── TestQuery-mysql5-59 │ │ ├── TestQuery-mysql5-65 │ │ ├── TestQuery-mysql5-91 │ │ ├── TestQuery-mysql8-105 │ │ ├── TestQuery-mysql8-106 │ │ ├── TestQuery-mysql8-109 │ │ ├── TestQuery-mysql8-111 │ │ ├── TestQuery-mysql8-125 │ │ ├── TestQuery-mysql8-126 │ │ ├── TestQuery-mysql8-154 │ │ ├── TestQuery-mysql8-155 │ │ ├── TestQuery-mysql8-167 │ │ ├── TestQuery-mysql8-179 │ │ ├── TestQuery-mysql8-193 │ │ ├── TestQuery-mysql8-36 │ │ ├── TestQuery-mysql8-41 │ │ ├── TestQuery-mysql8-43 │ │ ├── TestQuery-mysql8-59 │ │ ├── TestQuery-mysql8-76 │ │ ├── TestQuery-pg-184 │ │ ├── TestQuery-pg-29 │ │ ├── TestQuery-pg-38 │ │ ├── TestQuery-pg-43 │ │ ├── TestQuery-pgx-125 │ │ ├── TestQuery-pgx-126 │ │ ├── TestQuery-pgx-184 │ │ ├── TestQuery-pgx-186 │ │ ├── TestQuery-pgx-29 │ │ ├── TestQuery-pgx-38 │ │ ├── TestQuery-pgx-43 │ │ ├── TestQuery-sqlite-105 │ │ ├── TestQuery-sqlite-111 │ │ ├── TestQuery-sqlite-125 │ │ ├── TestQuery-sqlite-126 │ │ ├── TestQuery-sqlite-154 │ │ ├── TestQuery-sqlite-155 │ │ ├── TestQuery-sqlite-167 │ │ ├── TestQuery-sqlite-179 │ │ ├── TestQuery-sqlite-193 │ │ ├── TestQuery-sqlite-36 │ │ ├── TestQuery-sqlite-41 │ │ ├── TestQuery-sqlite-43 │ │ ├── TestQuery-sqlite-76 │ │ ├── TestQuery-mariadb-170 │ │ ├── TestQuery-mariadb-172 │ │ ├── TestQuery-mariadb-175 │ │ ├── TestQuery-mariadb-29 │ │ ├── TestQuery-mariadb-38 │ │ ├── TestQuery-mariadb-43 │ │ ├── TestQuery-mssql2019-109 │ │ ├── TestQuery-mssql2019-119 │ │ ├── TestQuery-mssql2019-120 │ │ ├── TestQuery-mssql2019-26 │ │ ├── TestQuery-mssql2019-41 │ │ ├── TestQuery-mssql2019-43 │ │ ├── TestQuery-mysql5-170 │ │ ├── TestQuery-mysql5-175 │ │ ├── TestQuery-mysql5-194 │ │ ├── TestQuery-mysql5-29 │ │ ├── TestQuery-mysql5-38 │ │ ├── TestQuery-mysql8-170 │ │ ├── TestQuery-mysql8-194 │ │ ├── TestQuery-mysql8-29 │ │ ├── TestQuery-mysql8-38 │ │ ├── TestQuery-pg-101 │ │ ├── TestQuery-pg-108 │ │ ├── TestQuery-pg-119 │ │ ├── TestQuery-pg-120 │ │ ├── TestQuery-pg-159 │ │ ├── TestQuery-pg-160 │ │ ├── TestQuery-pg-162 │ │ ├── TestQuery-pg-174 │ │ ├── TestQuery-pg-19 │ │ ├── TestQuery-pg-194 │ │ ├── TestQuery-pg-2 │ │ ├── TestQuery-pg-24 │ │ ├── TestQuery-pg-53 │ │ ├── TestQuery-pg-6 │ │ ├── TestQuery-pg-87 │ │ ├── TestQuery-pg-89 │ │ ├── TestQuery-pg-96 │ │ ├── TestQuery-pgx-101 │ │ ├── TestQuery-pgx-108 │ │ ├── TestQuery-pgx-159 │ │ ├── TestQuery-pgx-160 │ │ ├── TestQuery-pgx-162 │ │ ├── TestQuery-pgx-19 │ │ ├── TestQuery-pgx-194 │ │ ├── TestQuery-pgx-24 │ │ ├── TestQuery-pgx-53 │ │ ├── TestQuery-pgx-87 │ │ ├── TestQuery-pgx-89 │ │ ├── TestQuery-pgx-96 │ │ ├── TestQuery-sqlite-194 │ │ ├── TestQuery-sqlite-29 │ │ ├── TestQuery-sqlite-38 │ │ ├── TestAlterTable-pg-rename_table │ │ ├── TestQuery-mariadb-101 │ │ ├── TestQuery-mariadb-108 │ │ ├── TestQuery-mariadb-119 │ │ ├── TestQuery-mariadb-120 │ │ ├── TestQuery-mariadb-159 │ │ ├── TestQuery-mariadb-160 │ │ ├── TestQuery-mariadb-162 │ │ ├── TestQuery-mariadb-168 │ │ ├── TestQuery-mariadb-174 │ │ ├── TestQuery-mariadb-19 │ │ ├── TestQuery-mariadb-194 │ │ ├── TestQuery-mariadb-2 │ │ ├── TestQuery-mariadb-24 │ │ ├── TestQuery-mariadb-53 │ │ ├── TestQuery-mariadb-6 │ │ ├── TestQuery-mariadb-87 │ │ ├── TestQuery-mariadb-89 │ │ ├── TestQuery-mariadb-96 │ │ ├── TestQuery-mssql2019-101 │ │ ├── TestQuery-mssql2019-108 │ │ ├── TestQuery-mssql2019-135 │ │ ├── TestQuery-mssql2019-140 │ │ ├── TestQuery-mssql2019-145 │ │ ├── TestQuery-mssql2019-150 │ │ ├── TestQuery-mssql2019-161 │ │ ├── TestQuery-mssql2019-165 │ │ ├── TestQuery-mssql2019-175 │ │ ├── TestQuery-mssql2019-194 │ │ ├── TestQuery-mssql2019-24 │ │ ├── TestQuery-mssql2019-27 │ │ ├── TestQuery-mssql2019-29 │ │ ├── TestQuery-mssql2019-38 │ │ ├── TestQuery-mssql2019-53 │ │ ├── TestQuery-mssql2019-75 │ │ ├── TestQuery-mssql2019-87 │ │ ├── TestQuery-mssql2019-89 │ │ ├── TestQuery-mysql5-101 │ │ ├── TestQuery-mysql5-108 │ │ ├── TestQuery-mysql5-119 │ │ ├── TestQuery-mysql5-120 │ │ ├── TestQuery-mysql5-159 │ │ ├── TestQuery-mysql5-160 │ │ ├── TestQuery-mysql5-162 │ │ ├── TestQuery-mysql5-168 │ │ ├── TestQuery-mysql5-174 │ │ ├── TestQuery-mysql5-19 │ │ ├── TestQuery-mysql5-2 │ │ ├── TestQuery-mysql5-24 │ │ ├── TestQuery-mysql5-53 │ │ ├── TestQuery-mysql5-55 │ │ ├── TestQuery-mysql5-6 │ │ ├── TestQuery-mysql5-87 │ │ ├── TestQuery-mysql5-89 │ │ ├── TestQuery-mysql5-96 │ │ ├── TestQuery-mysql8-101 │ │ ├── TestQuery-mysql8-108 │ │ ├── TestQuery-mysql8-119 │ │ ├── TestQuery-mysql8-120 │ │ ├── TestQuery-mysql8-159 │ │ ├── TestQuery-mysql8-160 │ │ ├── TestQuery-mysql8-162 │ │ ├── TestQuery-mysql8-174 │ │ ├── TestQuery-mysql8-19 │ │ ├── TestQuery-mysql8-2 │ │ ├── TestQuery-mysql8-24 │ │ ├── TestQuery-mysql8-31 │ │ ├── TestQuery-mysql8-53 │ │ ├── TestQuery-mysql8-55 │ │ ├── TestQuery-mysql8-6 │ │ ├── TestQuery-mysql8-87 │ │ ├── TestQuery-mysql8-89 │ │ ├── TestQuery-mysql8-96 │ │ ├── TestQuery-pg-106 │ │ ├── TestQuery-pg-112 │ │ ├── TestQuery-pg-135 │ │ ├── TestQuery-pg-140 │ │ ├── TestQuery-pg-145 │ │ ├── TestQuery-pg-150 │ │ ├── TestQuery-pg-173 │ │ ├── TestQuery-pg-31 │ │ ├── TestQuery-pg-59 │ │ ├── TestQuery-pg-72 │ │ ├── TestQuery-pg-75 │ │ ├── TestQuery-pg-98 │ │ ├── TestQuery-pgx-106 │ │ ├── TestQuery-pgx-112 │ │ ├── TestQuery-pgx-119 │ │ ├── TestQuery-pgx-120 │ │ ├── TestQuery-pgx-135 │ │ ├── TestQuery-pgx-140 │ │ ├── TestQuery-pgx-145 │ │ ├── TestQuery-pgx-150 │ │ ├── TestQuery-pgx-173 │ │ ├── TestQuery-pgx-174 │ │ ├── TestQuery-pgx-2 │ │ ├── TestQuery-pgx-31 │ │ ├── TestQuery-pgx-59 │ │ ├── TestQuery-pgx-6 │ │ ├── TestQuery-pgx-72 │ │ ├── TestQuery-pgx-75 │ │ ├── TestQuery-pgx-98 │ │ ├── TestQuery-sqlite-101 │ │ ├── TestQuery-sqlite-106 │ │ ├── TestQuery-sqlite-108 │ │ ├── TestQuery-sqlite-119 │ │ ├── TestQuery-sqlite-120 │ │ ├── TestQuery-sqlite-159 │ │ ├── TestQuery-sqlite-160 │ │ ├── TestQuery-sqlite-162 │ │ ├── TestQuery-sqlite-174 │ │ ├── TestQuery-sqlite-19 │ │ ├── TestQuery-sqlite-2 │ │ ├── TestQuery-sqlite-24 │ │ ├── TestQuery-sqlite-31 │ │ ├── TestQuery-sqlite-53 │ │ ├── TestQuery-sqlite-55 │ │ ├── TestQuery-sqlite-59 │ │ ├── TestQuery-sqlite-6 │ │ ├── TestQuery-sqlite-87 │ │ ├── TestQuery-sqlite-89 │ │ ├── TestAlterTable-pg-drop_column │ │ ├── TestAlterTable-pgx-drop_column │ │ ├── TestAlterTable-pgx-rename_table │ │ ├── TestQuery-mariadb-106 │ │ ├── TestQuery-mariadb-110 │ │ ├── TestQuery-mariadb-112 │ │ ├── TestQuery-mariadb-131 │ │ ├── TestQuery-mariadb-169 │ │ ├── TestQuery-mariadb-173 │ │ ├── TestQuery-mariadb-59 │ │ ├── TestQuery-mariadb-60 │ │ ├── TestQuery-mariadb-72 │ │ ├── TestQuery-mariadb-75 │ │ ├── TestQuery-mariadb-84 │ │ ├── TestQuery-mariadb-98 │ │ ├── TestQuery-mssql2019-110 │ │ ├── TestQuery-mssql2019-159 │ │ ├── TestQuery-mssql2019-160 │ │ ├── TestQuery-mssql2019-162 │ │ ├── TestQuery-mssql2019-173 │ │ ├── TestQuery-mssql2019-174 │ │ ├── TestQuery-mssql2019-2 │ │ ├── TestQuery-mssql2019-6 │ │ ├── TestQuery-mssql2019-72 │ │ ├── TestQuery-mssql2019-84 │ │ ├── TestQuery-mysql5-110 │ │ ├── TestQuery-mysql5-112 │ │ ├── TestQuery-mysql5-131 │ │ ├── TestQuery-mysql5-141 │ │ ├── TestQuery-mysql5-169 │ │ ├── TestQuery-mysql5-173 │ │ ├── TestQuery-mysql5-54 │ │ ├── TestQuery-mysql5-60 │ │ ├── TestQuery-mysql5-72 │ │ ├── TestQuery-mysql5-75 │ │ ├── TestQuery-mysql5-84 │ │ ├── TestQuery-mysql5-98 │ │ ├── TestQuery-mysql8-110 │ │ ├── TestQuery-mysql8-112 │ │ ├── TestQuery-mysql8-131 │ │ ├── TestQuery-mysql8-141 │ │ ├── TestQuery-mysql8-173 │ │ ├── TestQuery-mysql8-54 │ │ ├── TestQuery-mysql8-60 │ │ ├── TestQuery-mysql8-72 │ │ ├── TestQuery-mysql8-75 │ │ ├── TestQuery-mysql8-84 │ │ ├── TestQuery-mysql8-98 │ │ ├── TestQuery-pg-1 │ │ ├── TestQuery-pg-109 │ │ ├── TestQuery-pg-110 │ │ ├── TestQuery-pg-13 │ │ ├── TestQuery-pg-168 │ │ ├── TestQuery-pg-169 │ │ ├── TestQuery-pg-170 │ │ ├── TestQuery-pg-171 │ │ ├── TestQuery-pg-37 │ │ ├── TestQuery-pg-60 │ │ ├── TestQuery-pg-71 │ │ ├── TestQuery-pg-84 │ │ ├── TestQuery-pgx-109 │ │ ├── TestQuery-pgx-110 │ │ ├── TestQuery-pgx-168 │ │ ├── TestQuery-pgx-169 │ │ ├── TestQuery-pgx-170 │ │ ├── TestQuery-pgx-171 │ │ ├── TestQuery-pgx-37 │ │ ├── TestQuery-pgx-60 │ │ ├── TestQuery-pgx-71 │ │ ├── TestQuery-pgx-84 │ │ ├── TestQuery-sqlite-109 │ │ ├── TestQuery-sqlite-112 │ │ ├── TestQuery-sqlite-135 │ │ ├── TestQuery-sqlite-140 │ │ ├── TestQuery-sqlite-145 │ │ ├── TestQuery-sqlite-150 │ │ ├── TestQuery-sqlite-173 │ │ ├── TestQuery-sqlite-60 │ │ ├── TestQuery-sqlite-72 │ │ ├── TestQuery-sqlite-75 │ │ ├── TestQuery-sqlite-98 │ │ ├── TestAlterTable-pg-add_primary_key │ │ ├── TestAlterTable-pgx-add_primary_key │ │ ├── TestQuery-mariadb-109 │ │ ├── TestQuery-mariadb-13 │ │ ├── TestQuery-mariadb-136 │ │ ├── TestQuery-mariadb-141 │ │ ├── TestQuery-mssql2019-112 │ │ ├── TestQuery-mssql2019-168 │ │ ├── TestQuery-mssql2019-169 │ │ ├── TestQuery-mssql2019-170 │ │ ├── TestQuery-mssql2019-171 │ │ ├── TestQuery-mssql2019-172 │ │ ├── TestQuery-mssql2019-185 │ │ ├── TestQuery-mssql2019-54 │ │ ├── TestQuery-mssql2019-55 │ │ ├── TestQuery-mssql2019-60 │ │ ├── TestQuery-mssql2019-63 │ │ ├── TestQuery-mssql2019-98 │ │ ├── TestQuery-mysql5-13 │ │ ├── TestQuery-mysql5-136 │ │ ├── TestQuery-mysql5-149 │ │ ├── TestQuery-mysql5-172 │ │ ├── TestQuery-mysql5-26 │ │ ├── TestQuery-mysql5-62 │ │ ├── TestQuery-mysql8-13 │ │ ├── TestQuery-mysql8-136 │ │ ├── TestQuery-mysql8-149 │ │ ├── TestQuery-mysql8-172 │ │ ├── TestQuery-mysql8-26 │ │ ├── TestQuery-mysql8-62 │ │ ├── TestQuery-pg-161 │ │ ├── TestQuery-pg-172 │ │ ├── TestQuery-pg-175 │ │ ├── TestQuery-pg-176 │ │ ├── TestQuery-pg-181 │ │ ├── TestQuery-pg-20 │ │ ├── TestQuery-pg-21 │ │ ├── TestQuery-pg-26 │ │ ├── TestQuery-pg-27 │ │ ├── TestQuery-pg-55 │ │ ├── TestQuery-pg-61 │ │ ├── TestQuery-pgx-1 │ │ ├── TestQuery-pgx-13 │ │ ├── TestQuery-pgx-161 │ │ ├── TestQuery-pgx-172 │ │ ├── TestQuery-pgx-175 │ │ ├── TestQuery-pgx-176 │ │ ├── TestQuery-pgx-181 │ │ ├── TestQuery-pgx-20 │ │ ├── TestQuery-pgx-21 │ │ ├── TestQuery-pgx-26 │ │ ├── TestQuery-pgx-27 │ │ ├── TestQuery-pgx-55 │ │ ├── TestQuery-pgx-61 │ │ ├── TestQuery-sqlite-110 │ │ ├── TestQuery-sqlite-13 │ │ ├── TestQuery-sqlite-168 │ │ ├── TestQuery-sqlite-169 │ │ ├── TestQuery-sqlite-170 │ │ ├── TestQuery-sqlite-171 │ │ ├── TestQuery-sqlite-26 │ │ ├── TestQuery-sqlite-37 │ │ ├── TestQuery-sqlite-62 │ │ ├── TestQuery-sqlite-84 │ │ ├── TestAlterTable-pg-drop_identity │ │ ├── TestAlterTable-pg-drop_primary_key │ │ ├── TestAlterTable-pgx-drop_primary_key │ │ ├── TestQuery-mariadb-149 │ │ ├── TestQuery-mariadb-161 │ │ ├── TestQuery-mariadb-165 │ │ ├── TestQuery-mariadb-176 │ │ ├── TestQuery-mariadb-181 │ │ ├── TestQuery-mariadb-20 │ │ ├── TestQuery-mariadb-21 │ │ ├── TestQuery-mariadb-26 │ │ ├── TestQuery-mariadb-27 │ │ ├── TestQuery-mariadb-37 │ │ ├── TestQuery-mariadb-55 │ │ ├── TestQuery-mariadb-88 │ │ ├── TestQuery-mssql2019-123 │ │ ├── TestQuery-mssql2019-129 │ │ ├── TestQuery-mssql2019-13 │ │ ├── TestQuery-mssql2019-130 │ │ ├── TestQuery-mssql2019-181 │ │ ├── TestQuery-mssql2019-189 │ │ ├── TestQuery-mssql2019-19 │ │ ├── TestQuery-mssql2019-37 │ │ ├── TestQuery-mysql5-161 │ │ ├── TestQuery-mysql5-165 │ │ ├── TestQuery-mysql5-176 │ │ ├── TestQuery-mysql5-181 │ │ ├── TestQuery-mysql5-20 │ │ ├── TestQuery-mysql5-21 │ │ ├── TestQuery-mysql5-27 │ │ ├── TestQuery-mysql5-37 │ │ ├── TestQuery-mysql5-80 │ │ ├── TestQuery-mysql5-88 │ │ ├── TestQuery-mysql8-161 │ │ ├── TestQuery-mysql8-165 │ │ ├── TestQuery-mysql8-168 │ │ ├── TestQuery-mysql8-175 │ │ ├── TestQuery-mysql8-176 │ │ ├── TestQuery-mysql8-181 │ │ ├── TestQuery-mysql8-20 │ │ ├── TestQuery-mysql8-21 │ │ ├── TestQuery-mysql8-27 │ │ ├── TestQuery-mysql8-37 │ │ ├── TestQuery-mysql8-80 │ │ ├── TestQuery-mysql8-88 │ │ ├── TestQuery-pg-113 │ │ ├── TestQuery-pg-114 │ │ ├── TestQuery-pg-12 │ │ ├── TestQuery-pg-14 │ │ ├── TestQuery-pg-185 │ │ ├── TestQuery-pg-65 │ │ ├── TestQuery-pg-88 │ │ ├── TestQuery-pg-91 │ │ ├── TestQuery-pgx-113 │ │ ├── TestQuery-pgx-114 │ │ ├── TestQuery-pgx-12 │ │ ├── TestQuery-pgx-14 │ │ ├── TestQuery-pgx-185 │ │ ├── TestQuery-pgx-65 │ │ ├── TestQuery-pgx-88 │ │ ├── TestQuery-pgx-91 │ │ ├── TestQuery-sqlite-151 │ │ ├── TestQuery-sqlite-161 │ │ ├── TestQuery-sqlite-172 │ │ ├── TestQuery-sqlite-175 │ │ ├── TestQuery-sqlite-176 │ │ ├── TestQuery-sqlite-181 │ │ ├── TestQuery-sqlite-20 │ │ ├── TestQuery-sqlite-21 │ │ ├── TestQuery-sqlite-27 │ │ ├── TestQuery-sqlite-71 │ │ ├── TestAlterTable-pg-add_default │ │ ├── TestAlterTable-pg-add_notnull │ │ ├── TestAlterTable-pg-drop_default │ │ ├── TestAlterTable-pgx-add_default │ │ ├── TestAlterTable-pgx-add_notnull │ │ ├── TestAlterTable-pgx-drop_default │ │ ├── TestAlterTable-pgx-drop_identity │ │ ├── TestQuery-mariadb-113 │ │ ├── TestQuery-mariadb-114 │ │ ├── TestQuery-mariadb-12 │ │ ├── TestQuery-mariadb-130 │ │ ├── TestQuery-mariadb-14 │ │ ├── TestQuery-mariadb-185 │ │ ├── TestQuery-mariadb-54 │ │ ├── TestQuery-mssql2019-113 │ │ ├── TestQuery-mssql2019-114 │ │ ├── TestQuery-mssql2019-12 │ │ ├── TestQuery-mssql2019-151 │ │ ├── TestQuery-mssql2019-176 │ │ ├── TestQuery-mssql2019-188 │ │ ├── TestQuery-mssql2019-190 │ │ ├── TestQuery-mssql2019-71 │ │ ├── TestQuery-mysql5-113 │ │ ├── TestQuery-mysql5-114 │ │ ├── TestQuery-mysql5-12 │ │ ├── TestQuery-mysql5-130 │ │ ├── TestQuery-mysql5-14 │ │ ├── TestQuery-mysql5-151 │ │ ├── TestQuery-mysql5-185 │ │ ├── TestQuery-mysql5-71 │ │ ├── TestQuery-mysql8-113 │ │ ├── TestQuery-mysql8-114 │ │ ├── TestQuery-mysql8-12 │ │ ├── TestQuery-mysql8-130 │ │ ├── TestQuery-mysql8-14 │ │ ├── TestQuery-mysql8-151 │ │ ├── TestQuery-mysql8-185 │ │ ├── TestQuery-mysql8-65 │ │ ├── TestQuery-mysql8-71 │ │ ├── TestQuery-mysql8-91 │ │ ├── TestQuery-pg-156 │ │ ├── TestQuery-pg-189 │ │ ├── TestQuery-pg-32 │ │ ├── TestQuery-pg-39 │ │ ├── TestQuery-pg-63 │ │ ├── TestQuery-pgx-156 │ │ ├── TestQuery-pgx-189 │ │ ├── TestQuery-pgx-32 │ │ ├── TestQuery-pgx-63 │ │ ├── TestQuery-sqlite-113 │ │ ├── TestQuery-sqlite-114 │ │ ├── TestQuery-sqlite-12 │ │ ├── TestQuery-sqlite-14 │ │ ├── TestQuery-sqlite-185 │ │ ├── TestQuery-sqlite-65 │ │ ├── TestQuery-sqlite-88 │ │ ├── TestQuery-sqlite-91 │ │ ├── TestAlterTable-pg-drop_foreign_key │ │ ├── TestAlterTable-pg-make_nullable │ │ ├── TestAlterTable-pg-rename_column │ │ ├── TestAlterTable-pgx-drop_foreign_key │ │ ├── TestAlterTable-pgx-make_nullable │ │ ├── TestQuery-mariadb-151 │ │ ├── TestQuery-mariadb-156 │ │ ├── TestQuery-mariadb-189 │ │ ├── TestQuery-mariadb-191 │ │ ├── TestQuery-mariadb-39 │ │ ├── TestQuery-mariadb-63 │ │ ├── TestQuery-mariadb-71 │ │ ├── TestQuery-mssql2019-14 │ │ ├── TestQuery-mssql2019-20 │ │ ├── TestQuery-mssql2019-21 │ │ ├── TestQuery-mssql2019-62 │ │ ├── TestQuery-mssql2019-80 │ │ ├── TestQuery-mssql2019-88 │ │ ├── TestQuery-mysql5-156 │ │ ├── TestQuery-mysql5-188 │ │ ├── TestQuery-mysql5-189 │ │ ├── TestQuery-mysql5-190 │ │ ├── TestQuery-mysql5-191 │ │ ├── TestQuery-mysql5-39 │ │ ├── TestQuery-mysql5-63 │ │ ├── TestQuery-mysql8-156 │ │ ├── TestQuery-mysql8-169 │ │ ├── TestQuery-mysql8-188 │ │ ├── TestQuery-mysql8-189 │ │ ├── TestQuery-mysql8-190 │ │ ├── TestQuery-mysql8-191 │ │ ├── TestQuery-mysql8-39 │ │ ├── TestQuery-mysql8-63 │ │ ├── TestQuery-pg-10 │ │ ├── TestQuery-pg-11 │ │ ├── TestQuery-pg-133 │ │ ├── TestQuery-pg-138 │ │ ├── TestQuery-pg-143 │ │ ├── TestQuery-pg-146 │ │ ├── TestQuery-pg-165 │ │ ├── TestQuery-pg-188 │ │ ├── TestQuery-pg-190 │ │ ├── TestQuery-pg-62 │ │ ├── TestQuery-pg-80 │ │ ├── TestQuery-pg-99 │ │ ├── TestQuery-pgx-10 │ │ ├── TestQuery-pgx-11 │ │ ├── TestQuery-pgx-133 │ │ ├── TestQuery-pgx-138 │ │ ├── TestQuery-pgx-143 │ │ ├── TestQuery-pgx-165 │ │ ├── TestQuery-pgx-188 │ │ ├── TestQuery-pgx-190 │ │ ├── TestQuery-pgx-39 │ │ ├── TestQuery-pgx-62 │ │ ├── TestQuery-sqlite-156 │ │ ├── TestQuery-sqlite-165 │ │ ├── TestQuery-sqlite-188 │ │ ├── TestQuery-sqlite-189 │ │ ├── TestQuery-sqlite-190 │ │ ├── TestQuery-sqlite-39 │ │ ├── TestQuery-sqlite-63 │ │ ├── TestAlterTable-pgx-rename_column │ │ ├── TestQuery-mariadb-10 │ │ ├── TestQuery-mariadb-11 │ │ ├── TestQuery-mariadb-135 │ │ ├── TestQuery-mariadb-146 │ │ ├── TestQuery-mariadb-188 │ │ ├── TestQuery-mariadb-190 │ │ ├── TestQuery-mariadb-62 │ │ ├── TestQuery-mariadb-80 │ │ ├── TestQuery-mariadb-99 │ │ ├── TestQuery-mssql2019-156 │ │ ├── TestQuery-mssql2019-191 │ │ ├── TestQuery-mssql2019-39 │ │ ├── TestQuery-mysql5-10 │ │ ├── TestQuery-mysql5-11 │ │ ├── TestQuery-mysql5-135 │ │ ├── TestQuery-mysql5-145 │ │ ├── TestQuery-mysql5-146 │ │ ├── TestQuery-mysql5-148 │ │ ├── TestQuery-mysql5-178 │ │ ├── TestQuery-mysql5-99 │ │ ├── TestQuery-mysql8-10 │ │ ├── TestQuery-mysql8-11 │ │ ├── TestQuery-mysql8-135 │ │ ├── TestQuery-mysql8-145 │ │ ├── TestQuery-mysql8-146 │ │ ├── TestQuery-mysql8-148 │ │ ├── TestQuery-mysql8-178 │ │ ├── TestQuery-mysql8-99 │ │ ├── TestQuery-pg-117 │ │ ├── TestQuery-pg-130 │ │ ├── TestQuery-pg-148 │ │ ├── TestQuery-pg-68 │ │ ├── TestQuery-pg-94 │ │ ├── TestQuery-pgx-117 │ │ ├── TestQuery-pgx-130 │ │ ├── TestQuery-pgx-146 │ │ ├── TestQuery-pgx-148 │ │ └── TestQuery-pgx-68 │ └── .env ├── .github └── FUNDING.yml ├── example ├── trivial │ └── main.go ├── migrate │ └── migrations │ │ └── 20210505110847_bar.down.sql ├── get-where-fields │ └── README.md ├── opentelemetry │ └── image │ │ └── bun-trace.png └── string-representation │ └── README.md ├── commitlint.config.js ├── .gitignore ├── extra └── bunotel │ └── README.md ├── version.go └── .prettierrc.yml /internal/dbtest/.gitignore: -------------------------------------------------------------------------------- 1 | /bench*.txt 2 | -------------------------------------------------------------------------------- /internal/dbtest/doc.go: -------------------------------------------------------------------------------- 1 | package dbtest 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://uptrace.dev/sponsor'] 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-7: -------------------------------------------------------------------------------- 1 | SELECT * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-7: -------------------------------------------------------------------------------- 1 | SELECT * 2 | -------------------------------------------------------------------------------- /example/trivial/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() {} 4 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-7: -------------------------------------------------------------------------------- 1 | SELECT * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-7: -------------------------------------------------------------------------------- 1 | SELECT * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-7: -------------------------------------------------------------------------------- 1 | SELECT * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-7: -------------------------------------------------------------------------------- 1 | SELECT * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-7: -------------------------------------------------------------------------------- 1 | SELECT * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-9: -------------------------------------------------------------------------------- 1 | SELECT * FROM table 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-9: -------------------------------------------------------------------------------- 1 | SELECT * FROM table 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-34: -------------------------------------------------------------------------------- 1 | DROP TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-9: -------------------------------------------------------------------------------- 1 | SELECT * FROM table 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-34: -------------------------------------------------------------------------------- 1 | DROP TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-9: -------------------------------------------------------------------------------- 1 | SELECT * FROM table 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-180: -------------------------------------------------------------------------------- 1 | /* test */ SELECT 1 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-34: -------------------------------------------------------------------------------- 1 | DROP TABLE "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-8: -------------------------------------------------------------------------------- 1 | SELECT * FROM "table" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-180: -------------------------------------------------------------------------------- 1 | /* test */ SELECT 1 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-34: -------------------------------------------------------------------------------- 1 | DROP TABLE "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-8: -------------------------------------------------------------------------------- 1 | SELECT * FROM "table" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-9: -------------------------------------------------------------------------------- 1 | SELECT * FROM table 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-0: -------------------------------------------------------------------------------- 1 | VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-34: -------------------------------------------------------------------------------- 1 | DROP TABLE "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-9: -------------------------------------------------------------------------------- 1 | SELECT * FROM table 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-0: -------------------------------------------------------------------------------- 1 | VALUES ROW(42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-180: -------------------------------------------------------------------------------- 1 | /* test */ SELECT 1 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-34: -------------------------------------------------------------------------------- 1 | DROP TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-45: -------------------------------------------------------------------------------- 1 | TRUNCATE TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-8: -------------------------------------------------------------------------------- 1 | SELECT * FROM `table` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-0: -------------------------------------------------------------------------------- 1 | VALUES (42, N'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-180: -------------------------------------------------------------------------------- 1 | /* test */ SELECT 1 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-34: -------------------------------------------------------------------------------- 1 | DROP TABLE "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-45: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-8: -------------------------------------------------------------------------------- 1 | SELECT * FROM "table" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-9: -------------------------------------------------------------------------------- 1 | SELECT * FROM table 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-0: -------------------------------------------------------------------------------- 1 | VALUES ROW(42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-180: -------------------------------------------------------------------------------- 1 | /* test */ SELECT 1 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-45: -------------------------------------------------------------------------------- 1 | TRUNCATE TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-8: -------------------------------------------------------------------------------- 1 | SELECT * FROM `table` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-0: -------------------------------------------------------------------------------- 1 | VALUES ROW(42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-180: -------------------------------------------------------------------------------- 1 | /* test */ SELECT 1 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-45: -------------------------------------------------------------------------------- 1 | TRUNCATE TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-8: -------------------------------------------------------------------------------- 1 | SELECT * FROM `table` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-180: -------------------------------------------------------------------------------- 1 | /* test */ SELECT 1 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-45: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-8: -------------------------------------------------------------------------------- 1 | SELECT * FROM "table" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-157: -------------------------------------------------------------------------------- 1 | bun: illegal VARCHAR length: -20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-177: -------------------------------------------------------------------------------- 1 | /* test */ DROP INDEX index_name 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-183: -------------------------------------------------------------------------------- 1 | /* test */ DROP TABLE "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-40: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (id IN (1, 2, 3)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-78: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((one) OR (two)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-183: -------------------------------------------------------------------------------- 1 | /* test */ DROP TABLE "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-40: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (id IN (1, 2, 3)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-78: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((one) OR (two)) 2 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] } 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-157: -------------------------------------------------------------------------------- 1 | bun: illegal VARCHAR length: -20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-177: -------------------------------------------------------------------------------- 1 | /* test */ DROP INDEX index_name 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-183: -------------------------------------------------------------------------------- 1 | /* test */ DROP TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-40: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (id IN (1, 2, 3)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-78: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((one) OR (two)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-183: -------------------------------------------------------------------------------- 1 | /* test */ DROP TABLE "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-78: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((one) OR (two)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-157: -------------------------------------------------------------------------------- 1 | bun: illegal VARCHAR length: -20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-177: -------------------------------------------------------------------------------- 1 | /* test */ DROP INDEX index_name 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-183: -------------------------------------------------------------------------------- 1 | /* test */ DROP TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-186: -------------------------------------------------------------------------------- 1 | /* test */ VALUES ROW(1, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-40: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (id IN (1, 2, 3)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-73: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (1 + 2.34 AS `sum`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-78: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((one) OR (two)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-157: -------------------------------------------------------------------------------- 1 | bun: illegal VARCHAR length: -20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-177: -------------------------------------------------------------------------------- 1 | /* test */ DROP INDEX index_name 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-183: -------------------------------------------------------------------------------- 1 | /* test */ DROP TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-186: -------------------------------------------------------------------------------- 1 | /* test */ VALUES ROW(1, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-40: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (id IN (1, 2, 3)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-73: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (1 + 2.34 AS `sum`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-78: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((one) OR (two)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-0: -------------------------------------------------------------------------------- 1 | VALUES (42::BIGINT, 'hello'::VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-131: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-136: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-141: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-149: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-158: -------------------------------------------------------------------------------- 1 | UPDATE xxx SET foo = NULL WHERE (1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-3: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-44: -------------------------------------------------------------------------------- 1 | ALTER TABLE "models" DROP COLUMN "str" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-73: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (1 + 2.34 AS "sum") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-74: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-85: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-0: -------------------------------------------------------------------------------- 1 | VALUES (42::BIGINT, 'hello'::VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-131: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-136: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-141: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-149: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-157: -------------------------------------------------------------------------------- 1 | bun: illegal VARCHAR length: -20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-158: -------------------------------------------------------------------------------- 1 | UPDATE xxx SET foo = NULL WHERE (1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-177: -------------------------------------------------------------------------------- 1 | /* test */ DROP INDEX index_name 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-3: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-73: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (1 + 2.34 AS "sum") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-1: -------------------------------------------------------------------------------- 1 | VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-157: -------------------------------------------------------------------------------- 1 | bun: illegal VARCHAR length: -20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-177: -------------------------------------------------------------------------------- 1 | /* test */ DROP INDEX index_name 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-183: -------------------------------------------------------------------------------- 1 | /* test */ DROP TABLE "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-184: -------------------------------------------------------------------------------- 1 | /* test */ DELETE FROM "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-186: -------------------------------------------------------------------------------- 1 | /* test */ VALUES (1, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-40: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (id IN (1, 2, 3)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-73: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (1 + 2.34 AS "sum") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-78: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((one) OR (two)) 2 | -------------------------------------------------------------------------------- /example/migrate/migrations/20210505110847_bar.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS {{.Prefix}}test; 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-drop_table: -------------------------------------------------------------------------------- 1 | DROP TABLE "hobbies"."movies" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-drop_table: -------------------------------------------------------------------------------- 1 | DROP TABLE "hobbies"."movies" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-125: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-126: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-158: -------------------------------------------------------------------------------- 1 | UPDATE xxx SET foo = NULL WHERE (1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-184: -------------------------------------------------------------------------------- 1 | /* test */ TRUNCATE TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-186: -------------------------------------------------------------------------------- 1 | /* test */ VALUES ROW(1, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-3: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-44: -------------------------------------------------------------------------------- 1 | ALTER TABLE `models` DROP COLUMN `str` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-73: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (1 + 2.34 AS `sum`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-74: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`) VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-76: -------------------------------------------------------------------------------- 1 | DELETE FROM `users` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-85: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`) VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-1: -------------------------------------------------------------------------------- 1 | VALUES (42, N'hello'), (43, N'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-157: -------------------------------------------------------------------------------- 1 | bun: illegal VARCHAR length: -20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-158: -------------------------------------------------------------------------------- 1 | UPDATE xxx SET foo = NULL WHERE (1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-177: -------------------------------------------------------------------------------- 1 | /* test */ DROP INDEX index_name 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-184: -------------------------------------------------------------------------------- 1 | /* test */ DELETE FROM "models" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-186: -------------------------------------------------------------------------------- 1 | /* test */ VALUES (1, N'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-3: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-40: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (id IN (1, 2, 3)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-73: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (1 + 2.34 AS "sum") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-76: -------------------------------------------------------------------------------- 1 | DELETE FROM "users" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-125: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-126: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-158: -------------------------------------------------------------------------------- 1 | UPDATE xxx SET foo = NULL WHERE (1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-184: -------------------------------------------------------------------------------- 1 | /* test */ TRUNCATE TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-3: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-44: -------------------------------------------------------------------------------- 1 | ALTER TABLE `models` DROP COLUMN `str` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-50: -------------------------------------------------------------------------------- 1 | bun: to bulk Update, use CTE and VALUES 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-74: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`) VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-76: -------------------------------------------------------------------------------- 1 | DELETE FROM `users` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-85: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`) VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-158: -------------------------------------------------------------------------------- 1 | UPDATE xxx SET foo = NULL WHERE (1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-184: -------------------------------------------------------------------------------- 1 | /* test */ TRUNCATE TABLE `models` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-3: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-44: -------------------------------------------------------------------------------- 1 | ALTER TABLE `models` DROP COLUMN `str` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-50: -------------------------------------------------------------------------------- 1 | bun: to bulk Update, use CTE and VALUES 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-74: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`) VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-85: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`) VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-4: -------------------------------------------------------------------------------- 1 | SELECT "model"."id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-42: -------------------------------------------------------------------------------- 1 | DROP INDEX CONCURRENTLY IF EXISTS title_idx 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-45: -------------------------------------------------------------------------------- 1 | TRUNCATE TABLE "models" RESTART IDENTITY 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-5: -------------------------------------------------------------------------------- 1 | SELECT "id", "str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-50: -------------------------------------------------------------------------------- 1 | bun: to bulk Update, use CTE and VALUES 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-58: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-44: -------------------------------------------------------------------------------- 1 | ALTER TABLE "models" DROP COLUMN "str" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-45: -------------------------------------------------------------------------------- 1 | TRUNCATE TABLE "models" RESTART IDENTITY 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-5: -------------------------------------------------------------------------------- 1 | SELECT "id", "str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-50: -------------------------------------------------------------------------------- 1 | bun: to bulk Update, use CTE and VALUES 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-58: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-74: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-85: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-131: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-136: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-141: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-149: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-158: -------------------------------------------------------------------------------- 1 | UPDATE xxx SET foo = NULL WHERE (1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-3: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-44: -------------------------------------------------------------------------------- 1 | ALTER TABLE "models" DROP COLUMN "str" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-50: -------------------------------------------------------------------------------- 1 | bun: to bulk Update, use CTE and VALUES 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-74: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-85: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-1: -------------------------------------------------------------------------------- 1 | VALUES ROW(42, 'hello'), ROW(43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-31: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` WHERE (`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-4: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-42: -------------------------------------------------------------------------------- 1 | DROP INDEX CONCURRENTLY IF EXISTS title_idx 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-5: -------------------------------------------------------------------------------- 1 | SELECT `id`, `str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-50: -------------------------------------------------------------------------------- 1 | bun: to bulk Update, use CTE and VALUES 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-58: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`raw`) VALUES (NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-125: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-126: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-131: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-136: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-141: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-149: -------------------------------------------------------------------------------- 1 | SELECT "id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-31: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" WHERE ("id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-44: -------------------------------------------------------------------------------- 1 | ALTER TABLE "models" DROP COLUMN "str" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-50: -------------------------------------------------------------------------------- 1 | bun: to bulk Update, use CTE and VALUES 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-61: -------------------------------------------------------------------------------- 1 | VALUES (NULL), ('1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-74: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-85: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-96: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("str") VALUES (N'') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-1: -------------------------------------------------------------------------------- 1 | VALUES ROW(42, 'hello'), ROW(43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-31: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` WHERE (`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-4: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-42: -------------------------------------------------------------------------------- 1 | DROP INDEX CONCURRENTLY IF EXISTS title_idx 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-5: -------------------------------------------------------------------------------- 1 | SELECT `id`, `str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-58: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`raw`) VALUES (NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-61: -------------------------------------------------------------------------------- 1 | VALUES ROW(NULL), ROW('1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-1: -------------------------------------------------------------------------------- 1 | VALUES ROW(42, 'hello'), ROW(43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-4: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-42: -------------------------------------------------------------------------------- 1 | DROP INDEX CONCURRENTLY IF EXISTS title_idx 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-5: -------------------------------------------------------------------------------- 1 | SELECT `id`, `str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-58: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`raw`) VALUES (NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-61: -------------------------------------------------------------------------------- 1 | VALUES ROW(NULL), ROW('1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-105: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES ('embed') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-111: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (x IN ('\x666f6f', '\x626172')) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-125: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-126: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-167: -------------------------------------------------------------------------------- 1 | INSERT INTO "table" ("default") VALUES (FALSE) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-186: -------------------------------------------------------------------------------- 1 | /* test */ VALUES (1::BIGINT, 'hello'::VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-36: -------------------------------------------------------------------------------- 1 | SELECT "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-41: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((id1, id2) IN ((1, 2), (3, 4))) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-76: -------------------------------------------------------------------------------- 1 | DELETE FROM "users" AS "user" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-105: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES ('embed') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-111: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (x IN ('\x666f6f', '\x626172')) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-167: -------------------------------------------------------------------------------- 1 | INSERT INTO "table" ("default") VALUES (FALSE) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-36: -------------------------------------------------------------------------------- 1 | SELECT "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-4: -------------------------------------------------------------------------------- 1 | SELECT "model"."id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-41: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((id1, id2) IN ((1, 2), (3, 4))) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-42: -------------------------------------------------------------------------------- 1 | DROP INDEX CONCURRENTLY IF EXISTS title_idx 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-76: -------------------------------------------------------------------------------- 1 | DELETE FROM "users" AS "user" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-4: -------------------------------------------------------------------------------- 1 | SELECT "model"."id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-42: -------------------------------------------------------------------------------- 1 | DROP INDEX CONCURRENTLY IF EXISTS title_idx 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-5: -------------------------------------------------------------------------------- 1 | SELECT "id", "str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-58: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-61: -------------------------------------------------------------------------------- 1 | VALUES (NULL), ('1970-01-01 00:00:00+00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-96: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("str") VALUES ('') 2 | -------------------------------------------------------------------------------- /internal/dbtest/.env: -------------------------------------------------------------------------------- 1 | COMPOSE_PROJECT_NAME=dbtest 2 | DOCKER_BUILDKIT=1 3 | COMPOSE_DOCKER_CLI_BUILD=1 4 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-105: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`) VALUES ('embed') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-111: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (x IN (X'666f6f', X'626172')) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-154: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-155: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-167: -------------------------------------------------------------------------------- 1 | INSERT INTO `table` (`default`) VALUES (FALSE) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-179: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-193: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-36: -------------------------------------------------------------------------------- 1 | SELECT `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-41: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((id1, id2) IN ((1, 2), (3, 4))) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-61: -------------------------------------------------------------------------------- 1 | VALUES ROW(NULL), ROW('1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-65: -------------------------------------------------------------------------------- 1 | DELETE FROM `soft_deletes` WHERE (`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-91: -------------------------------------------------------------------------------- 1 | DELETE FROM `soft_deletes` WHERE (`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-105: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES (N'embed') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-106: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (DEFAULT) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-111: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (x IN (0x666f6f, 0x626172)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-167: -------------------------------------------------------------------------------- 1 | INSERT INTO "table" ("default") VALUES (0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-36: -------------------------------------------------------------------------------- 1 | SELECT "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-4: -------------------------------------------------------------------------------- 1 | SELECT "model"."id" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-42: -------------------------------------------------------------------------------- 1 | DROP INDEX CONCURRENTLY IF EXISTS title_idx 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-5: -------------------------------------------------------------------------------- 1 | SELECT "id", "str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-58: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-59: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (DEFAULT) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-65: -------------------------------------------------------------------------------- 1 | DELETE FROM "soft_deletes" WHERE ("id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-91: -------------------------------------------------------------------------------- 1 | DELETE FROM "soft_deletes" WHERE ("id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-105: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`) VALUES ('embed') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-106: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`raw`) VALUES (DEFAULT) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-109: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`time`) VALUES (DEFAULT) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-111: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (x IN (X'666f6f', X'626172')) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-154: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-155: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-167: -------------------------------------------------------------------------------- 1 | INSERT INTO `table` (`default`) VALUES (FALSE) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-179: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-193: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-36: -------------------------------------------------------------------------------- 1 | SELECT `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-41: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((id1, id2) IN ((1, 2), (3, 4))) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-43: -------------------------------------------------------------------------------- 1 | ALTER TABLE `models` ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-59: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`raw`) VALUES (DEFAULT) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-65: -------------------------------------------------------------------------------- 1 | DELETE FROM `soft_deletes` WHERE (`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-91: -------------------------------------------------------------------------------- 1 | DELETE FROM `soft_deletes` WHERE (`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-105: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`) VALUES ('embed') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-106: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`raw`) VALUES (DEFAULT) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-109: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`time`) VALUES (DEFAULT) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-111: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (x IN (X'666f6f', X'626172')) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-125: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` AS `model` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-126: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` AS `model` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-154: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-155: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-167: -------------------------------------------------------------------------------- 1 | INSERT INTO `table` (`default`) VALUES (FALSE) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-179: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-193: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-36: -------------------------------------------------------------------------------- 1 | SELECT `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-41: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((id1, id2) IN ((1, 2), (3, 4))) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-43: -------------------------------------------------------------------------------- 1 | ALTER TABLE `models` ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-59: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`raw`) VALUES (DEFAULT) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-76: -------------------------------------------------------------------------------- 1 | DELETE FROM `users` AS `user` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-184: -------------------------------------------------------------------------------- 1 | /* test */ TRUNCATE TABLE "models" RESTART IDENTITY 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-29: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = 'hello' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-38: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX "title_idx" ON "films" ("title") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-43: -------------------------------------------------------------------------------- 1 | ALTER TABLE "models" ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-125: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-126: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-184: -------------------------------------------------------------------------------- 1 | /* test */ TRUNCATE TABLE "models" RESTART IDENTITY 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-186: -------------------------------------------------------------------------------- 1 | /* test */ VALUES (1::BIGINT, 'hello'::VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-29: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = 'hello' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-38: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX "title_idx" ON "films" ("title") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-43: -------------------------------------------------------------------------------- 1 | ALTER TABLE "models" ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-105: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id") VALUES ('embed') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-111: -------------------------------------------------------------------------------- 1 | SELECT * WHERE (x IN (X'666f6f', X'626172')) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-125: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-126: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-154: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-155: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-167: -------------------------------------------------------------------------------- 1 | INSERT INTO "table" ("default") VALUES (FALSE) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-179: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-193: -------------------------------------------------------------------------------- 1 | bun: merge not supported for current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-36: -------------------------------------------------------------------------------- 1 | SELECT "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-41: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((id1, id2) IN ((1, 2), (3, 4))) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-43: -------------------------------------------------------------------------------- 1 | ALTER TABLE "models" ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-76: -------------------------------------------------------------------------------- 1 | DELETE FROM "users" AS "user" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-170: -------------------------------------------------------------------------------- 1 | bun: can't use ORDER or LIMIT with multiple tables 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-172: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` WHERE (`id` = NULL) RETURNING * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-175: -------------------------------------------------------------------------------- 1 | /* test */ DELETE FROM `models` WHERE (`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-29: -------------------------------------------------------------------------------- 1 | UPDATE `models` SET `str` = 'hello' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-38: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX `title_idx` ON `films` (`title`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-43: -------------------------------------------------------------------------------- 1 | ALTER TABLE `models` ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-109: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES (DEFAULT) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-119: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = N'' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-120: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = N'' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-26: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = N'' WHERE ("id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-41: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((id1, id2) IN ((1, 2), (3, 4))) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-43: -------------------------------------------------------------------------------- 1 | ALTER TABLE "models" ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-170: -------------------------------------------------------------------------------- 1 | bun: can't use ORDER or LIMIT with multiple tables 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-175: -------------------------------------------------------------------------------- 1 | /* test */ DELETE FROM `models` WHERE (`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-194: -------------------------------------------------------------------------------- 1 | SELECT * ORDER BY `foo` ASC, `foo`.`bar` DESC, `xxx` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-29: -------------------------------------------------------------------------------- 1 | UPDATE `models` SET `str` = 'hello' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-38: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX `title_idx` ON `films` (`title`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-170: -------------------------------------------------------------------------------- 1 | bun: can't use ORDER or LIMIT with multiple tables 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-194: -------------------------------------------------------------------------------- 1 | SELECT * ORDER BY `foo` ASC, `foo`.`bar` DESC, `xxx` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-29: -------------------------------------------------------------------------------- 1 | UPDATE `models` SET `str` = 'hello' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-38: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX `title_idx` ON `films` (`title`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-101: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" (email VARCHAR, password VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-108: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "slice") VALUES (123, '[]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-119: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-120: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-159: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-160: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-162: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-174: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE "models" DROP COLUMN "column_name" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-19: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-194: -------------------------------------------------------------------------------- 1 | SELECT * ORDER BY "foo" ASC, "foo"."bar" DESC, "xxx" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-2: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-24: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-53: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("array") VALUES ('{"foo","bar"}') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-6: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-87: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-89: -------------------------------------------------------------------------------- 1 | INSERT INTO "dest" (id, name) SELECT id, name FROM "src" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-96: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (DEFAULT, '') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-101: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" (email VARCHAR, password VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-108: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "slice") VALUES (123, '[]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-159: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-160: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-162: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-19: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-194: -------------------------------------------------------------------------------- 1 | SELECT * ORDER BY "foo" ASC, "foo"."bar" DESC, "xxx" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-24: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-53: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("array") VALUES ('{"foo","bar"}') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-87: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-89: -------------------------------------------------------------------------------- 1 | INSERT INTO "dest" (id, name) SELECT id, name FROM "src" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-96: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (DEFAULT, '') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-194: -------------------------------------------------------------------------------- 1 | SELECT * ORDER BY "foo" ASC, "foo"."bar" DESC, "xxx" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-29: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = 'hello' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-38: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX "title_idx" ON "films" ("title") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-rename_table: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" RENAME TO "films" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-101: -------------------------------------------------------------------------------- 1 | CREATE TABLE `models` (email VARCHAR, password VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-108: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `slice`) VALUES (123, '[]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-119: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-120: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-159: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-160: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-162: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-168: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` WHERE (`id` = NULL) ORDER BY `id` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-174: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE `models` DROP COLUMN `column_name` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-19: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-194: -------------------------------------------------------------------------------- 1 | SELECT * ORDER BY `foo` ASC, `foo`.`bar` DESC, `xxx` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-2: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-24: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-53: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`array`) VALUES ('["foo","bar"]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-6: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-87: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-89: -------------------------------------------------------------------------------- 1 | INSERT INTO `dest` (id, name) SELECT id, name FROM `src` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-96: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (DEFAULT, '') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-101: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" (email VARCHAR, password VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-108: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "slice") VALUES (123, '[]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-135: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = N'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-140: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = N'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-145: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = N'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-150: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = N'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-161: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = N'' WHERE ("id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-165: -------------------------------------------------------------------------------- 1 | UPDATE "accounts" SET "is_active" = 0 WHERE ("id" = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-175: -------------------------------------------------------------------------------- 1 | /* test */ DELETE FROM "models" WHERE ("id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-194: -------------------------------------------------------------------------------- 1 | SELECT * ORDER BY "foo" ASC, "foo"."bar" DESC, "xxx" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-24: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, N'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-27: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = N'hello' WHERE ("id" = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-29: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = N'hello' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-38: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX "title_idx" ON "films" ("title") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-53: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("array") VALUES ('["foo","bar"]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-75: -------------------------------------------------------------------------------- 1 | UPDATE "users" SET name = N'Hello' WHERE (id = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-87: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-89: -------------------------------------------------------------------------------- 1 | INSERT INTO "dest" (id, name) SELECT id, name FROM "src" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-101: -------------------------------------------------------------------------------- 1 | CREATE TABLE `models` (email VARCHAR, password VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-108: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `slice`) VALUES (123, '[]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-119: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-120: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-159: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-160: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-162: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-168: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` WHERE (`id` = NULL) ORDER BY `id` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-174: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE `models` DROP COLUMN `column_name` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-19: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-2: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-24: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-53: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`array`) VALUES ('["foo","bar"]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-55: -------------------------------------------------------------------------------- 1 | REPLACE INTO `models` (`id`, `str`) VALUES (DEFAULT, '') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-6: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-87: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-89: -------------------------------------------------------------------------------- 1 | INSERT INTO `dest` (id, name) SELECT id, name FROM `src` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-96: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (DEFAULT, '') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-101: -------------------------------------------------------------------------------- 1 | CREATE TABLE `models` (email VARCHAR, password VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-108: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `slice`) VALUES (123, '[]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-119: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-120: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-159: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-160: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-162: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-174: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE `models` DROP COLUMN `column_name` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-19: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-2: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-24: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-31: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` AS `model` WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-53: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`array`) VALUES ('["foo","bar"]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-55: -------------------------------------------------------------------------------- 1 | REPLACE INTO `models` (`id`, `str`) VALUES (DEFAULT, '') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-6: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-87: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-89: -------------------------------------------------------------------------------- 1 | INSERT INTO `dest` (id, name) SELECT id, name FROM `src` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-96: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (DEFAULT, '') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-106: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (DEFAULT) RETURNING "raw" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-112: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-135: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-140: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-145: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-150: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-173: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE "models" ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-31: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-59: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (DEFAULT) RETURNING "raw" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-72: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-75: -------------------------------------------------------------------------------- 1 | UPDATE "users" AS "user" SET name = 'Hello' WHERE (id = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-98: -------------------------------------------------------------------------------- 1 | ALTER TABLE mytable ADD IF NOT EXISTS column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-106: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (DEFAULT) RETURNING "raw" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-112: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-119: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-120: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-135: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-140: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-145: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-150: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-173: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE "models" ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-174: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE "models" DROP COLUMN "column_name" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-2: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-31: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-59: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (DEFAULT) RETURNING "raw" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-6: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-72: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-75: -------------------------------------------------------------------------------- 1 | UPDATE "users" AS "user" SET name = 'Hello' WHERE (id = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-98: -------------------------------------------------------------------------------- 1 | ALTER TABLE mytable ADD IF NOT EXISTS column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-101: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" (email VARCHAR, password VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-106: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (NULL) RETURNING "raw" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-108: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "slice") VALUES (123, '[]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-119: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-120: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-159: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-160: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-162: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-174: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE "models" DROP COLUMN "column_name" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-19: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-2: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-24: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-31: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-53: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("array") VALUES ('["foo","bar"]') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-55: -------------------------------------------------------------------------------- 1 | REPLACE INTO "models" ("str") VALUES ('') RETURNING "id" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-59: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("raw") VALUES (NULL) RETURNING "raw" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-6: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-87: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-89: -------------------------------------------------------------------------------- 1 | INSERT INTO "dest" (id, name) SELECT id, name FROM "src" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-drop_column: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" DROP COLUMN "director" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-drop_column: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" DROP COLUMN "director" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-rename_table: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" RENAME TO "films" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-106: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`raw`) VALUES (DEFAULT) RETURNING `raw` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-110: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`time`) VALUES ('1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-112: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-131: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` USE INDEX (`ix1`, `ix2`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-169: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` WHERE (`id` = NULL) ORDER BY `id` LIMIT 1 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-173: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE `models` ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-59: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`raw`) VALUES (DEFAULT) RETURNING `raw` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-60: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`bytes`) VALUES (X'00000000000000000000') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-72: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-75: -------------------------------------------------------------------------------- 1 | UPDATE `users` AS `user` SET name = 'Hello' WHERE (id = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-84: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`time`) VALUES ('0001-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-98: -------------------------------------------------------------------------------- 1 | ALTER TABLE mytable ADD IF NOT EXISTS column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-110: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES ('1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-159: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-160: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-162: -------------------------------------------------------------------------------- 1 | bun: empty SET clause is not allowed in the UPDATE query 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-173: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE "models" ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-174: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE "models" DROP COLUMN "column_name" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-2: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-6: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-72: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-84: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES ('0001-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-110: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`time`) VALUES ('1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-112: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-131: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` USE INDEX (`ix1`, `ix2`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-141: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` FORCE INDEX (`ix1`, `ix2`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-169: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` WHERE (`id` = NULL) ORDER BY `id` LIMIT 1 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-173: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE `models` ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-54: -------------------------------------------------------------------------------- 1 | INSERT IGNORE INTO `models` (`id`, `str`) VALUES (DEFAULT, '') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-60: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`bytes`) VALUES (X'00000000000000000000') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-72: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-75: -------------------------------------------------------------------------------- 1 | UPDATE `users` AS `user` SET name = 'Hello' WHERE (id = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-84: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`time`) VALUES ('0001-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-98: -------------------------------------------------------------------------------- 1 | ALTER TABLE mytable ADD IF NOT EXISTS column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-110: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`time`) VALUES ('1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-112: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-131: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` USE INDEX (`ix1`, `ix2`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-141: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` FORCE INDEX (`ix1`, `ix2`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-173: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE `models` ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-54: -------------------------------------------------------------------------------- 1 | INSERT IGNORE INTO `models` (`id`, `str`) VALUES (DEFAULT, '') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-60: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`bytes`) VALUES (X'00000000000000000000') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-72: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-75: -------------------------------------------------------------------------------- 1 | UPDATE `users` AS `user` SET name = 'Hello' WHERE (id = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-84: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`time`) VALUES ('0001-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-98: -------------------------------------------------------------------------------- 1 | ALTER TABLE mytable ADD IF NOT EXISTS column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-1: -------------------------------------------------------------------------------- 1 | VALUES (42::BIGINT, 'hello'::VARCHAR), (43::BIGINT, 'world'::VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-109: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES (DEFAULT) RETURNING "time" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-110: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES ('1970-01-01 00:00:00+00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-13: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-168: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-169: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-170: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-171: -------------------------------------------------------------------------------- 1 | bun: feature UpdateOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-37: -------------------------------------------------------------------------------- 1 | CREATE TABLE "users" ("name" VARCHAR NOT NULL DEFAULT \'unknown\') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-60: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("bytes") VALUES ('\x00000000000000000000') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-71: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" ("id" BIGSERIAL NOT NULL, PRIMARY KEY ("id")) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-84: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES ('0001-01-01 00:00:00+00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-109: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES (DEFAULT) RETURNING "time" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-110: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES ('1970-01-01 00:00:00+00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-168: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-169: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-170: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-171: -------------------------------------------------------------------------------- 1 | bun: feature UpdateOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-37: -------------------------------------------------------------------------------- 1 | CREATE TABLE "users" ("name" VARCHAR NOT NULL DEFAULT \'unknown\') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-60: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("bytes") VALUES ('\x00000000000000000000') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-71: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" ("id" BIGSERIAL NOT NULL, PRIMARY KEY ("id")) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-84: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES ('0001-01-01 00:00:00+00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-109: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES (NULL) RETURNING "time" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-112: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-135: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-140: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-145: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-150: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-173: -------------------------------------------------------------------------------- 1 | /* test */ ALTER TABLE "models" ADD column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-60: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("bytes") VALUES (X'00000000000000000000') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-72: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-75: -------------------------------------------------------------------------------- 1 | UPDATE "users" AS "user" SET name = 'Hello' WHERE (id = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-98: -------------------------------------------------------------------------------- 1 | ALTER TABLE mytable ADD IF NOT EXISTS column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Patterns for files created by this project. 2 | # For other files, use global gitignore. 3 | *.s3db 4 | .idea 5 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-add_primary_key: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ADD PRIMARY KEY (id) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-add_primary_key: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ADD PRIMARY KEY (id) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-109: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`time`) VALUES (DEFAULT) RETURNING `time` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-13: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-136: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` IGNORE INDEX (`ix1`, `ix2`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-141: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` FORCE INDEX (`ix1`, `ix2`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-112: -------------------------------------------------------------------------------- 1 | SELECT * WHERE ((a = 1) AND (b = 1)) OR ((a = 2) AND (b = 2)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-168: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-169: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-170: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-171: -------------------------------------------------------------------------------- 1 | bun: feature UpdateOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-172: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-185: -------------------------------------------------------------------------------- 1 | /* test */ UPDATE "models" SET name = N'new-name' WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-54: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("str") OUTPUT INSERTED."id" VALUES (N'') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-55: -------------------------------------------------------------------------------- 1 | REPLACE INTO "models" ("str") OUTPUT INSERTED."id" VALUES (N'') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-60: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("bytes") VALUES (0x00000000000000000000) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-63: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "str" = N'', foo = N'bar' WHERE ("id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-98: -------------------------------------------------------------------------------- 1 | ALTER TABLE mytable ADD IF NOT EXISTS column_name VARCHAR(123) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-13: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-136: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` IGNORE INDEX (`ix1`, `ix2`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-149: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` USE INDEX (`ix1`, `ix2`, `ix3`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-172: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-26: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-62: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`, `foo`) VALUES (DEFAULT, '', 'bar') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-13: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-136: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` IGNORE INDEX (`ix1`, `ix2`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-149: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` USE INDEX (`ix1`, `ix2`, `ix3`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-172: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-26: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-62: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`, `foo`) VALUES (DEFAULT, '', 'bar') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-161: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-172: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE ("model"."id" = NULL) RETURNING * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-175: -------------------------------------------------------------------------------- 1 | /* test */ DELETE FROM "models" AS "model" WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-176: -------------------------------------------------------------------------------- 1 | /* test */ CREATE UNIQUE INDEX "index_name" ON "models" ("column_name") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-181: -------------------------------------------------------------------------------- 1 | /* test */ SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-20: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-21: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-26: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-27: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE ("model"."id" = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-55: -------------------------------------------------------------------------------- 1 | REPLACE INTO "models" ("id", "str") VALUES (DEFAULT, '') RETURNING "id" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-61: -------------------------------------------------------------------------------- 1 | VALUES (NULL::TIMESTAMPTZ), ('1970-01-01 00:00:00+00:00'::TIMESTAMPTZ) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-1: -------------------------------------------------------------------------------- 1 | VALUES (42::BIGINT, 'hello'::VARCHAR), (43::BIGINT, 'world'::VARCHAR) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-13: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-161: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-172: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE ("model"."id" = NULL) RETURNING * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-175: -------------------------------------------------------------------------------- 1 | /* test */ DELETE FROM "models" AS "model" WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-176: -------------------------------------------------------------------------------- 1 | /* test */ CREATE UNIQUE INDEX "index_name" ON "models" ("column_name") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-181: -------------------------------------------------------------------------------- 1 | /* test */ SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-20: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-21: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-26: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-27: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE ("model"."id" = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-55: -------------------------------------------------------------------------------- 1 | REPLACE INTO "models" ("id", "str") VALUES (DEFAULT, '') RETURNING "id" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-61: -------------------------------------------------------------------------------- 1 | VALUES (NULL::TIMESTAMPTZ), ('1970-01-01 00:00:00+00:00'::TIMESTAMPTZ) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-110: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES ('1970-01-01 00:00:00+00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-13: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-168: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-169: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-170: -------------------------------------------------------------------------------- 1 | bun: feature DeleteOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-171: -------------------------------------------------------------------------------- 1 | bun: feature UpdateOrderLimit is not supported by current dialect 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-26: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-37: -------------------------------------------------------------------------------- 1 | CREATE TABLE "users" ("name" VARCHAR NOT NULL DEFAULT \'unknown\') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-62: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("str", "foo") VALUES ('', 'bar') RETURNING "id" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-84: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") VALUES ('0001-01-01 00:00:00+00:00') 2 | -------------------------------------------------------------------------------- /example/get-where-fields/README.md: -------------------------------------------------------------------------------- 1 | # Get Where fields 2 | 3 | To run this example: 4 | 5 | ```shell 6 | go run main.go 7 | ``` 8 | -------------------------------------------------------------------------------- /example/opentelemetry/image/bun-trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uptrace/bun/HEAD/example/opentelemetry/image/bun-trace.png -------------------------------------------------------------------------------- /extra/bunotel/README.md: -------------------------------------------------------------------------------- 1 | # OpenTelemetry instrumentation for Bun 2 | 3 | See [example](../../example/opentelemetry) for details. 4 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-drop_identity: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ALTER COLUMN "id" DROP IDENTITY 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-drop_primary_key: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" DROP CONSTRAINT "new_pk" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-drop_primary_key: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" DROP CONSTRAINT "new_pk" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-149: -------------------------------------------------------------------------------- 1 | SELECT `id` FROM `models` AS `model` USE INDEX (`ix1`, `ix2`, `ix3`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-161: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-165: -------------------------------------------------------------------------------- 1 | UPDATE `accounts` SET `is_active` = FALSE WHERE (`accounts`.`id` = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-176: -------------------------------------------------------------------------------- 1 | /* test */ CREATE UNIQUE INDEX `index_name` ON `models` (`column_name`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-181: -------------------------------------------------------------------------------- 1 | /* test */ SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-20: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-21: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-26: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-27: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = 'hello' WHERE (`model`.`id` = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-37: -------------------------------------------------------------------------------- 1 | CREATE TABLE `users` (`name` VARCHAR(255) NOT NULL DEFAULT \'unknown\') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-55: -------------------------------------------------------------------------------- 1 | REPLACE INTO `models` (`id`, `str`) VALUES (DEFAULT, '') RETURNING `id` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-88: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `time`) VALUES (123, '1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-123: -------------------------------------------------------------------------------- 1 | UPDATE "soft_deletes" SET "deleted_at" = DEFAULT WHERE ("id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-129: -------------------------------------------------------------------------------- 1 | UPDATE "soft_deletes" SET "deleted_at" = [TIME] WHERE ("id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-13: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-130: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "updated_at" = NOW() OUTPUT * WHERE ("id" = 0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-181: -------------------------------------------------------------------------------- 1 | /* test */ SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-189: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "name" = name2, updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-19: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("str") OUTPUT INSERTED."id" VALUES (N'hello') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-37: -------------------------------------------------------------------------------- 1 | CREATE TABLE "users" ("name" VARCHAR(255) NOT NULL DEFAULT \'unknown\') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-161: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-165: -------------------------------------------------------------------------------- 1 | UPDATE `accounts` SET `is_active` = FALSE WHERE (`accounts`.`id` = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-176: -------------------------------------------------------------------------------- 1 | /* test */ CREATE UNIQUE INDEX `index_name` ON `models` (`column_name`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-181: -------------------------------------------------------------------------------- 1 | /* test */ SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-20: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-21: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-27: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = 'hello' WHERE (`model`.`id` = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-37: -------------------------------------------------------------------------------- 1 | CREATE TABLE `users` (`name` VARCHAR(255) NOT NULL DEFAULT \'unknown\') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-80: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'custom'), (43, 'custom') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-88: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `time`) VALUES (123, '1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-161: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '' WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-165: -------------------------------------------------------------------------------- 1 | UPDATE `accounts` SET `is_active` = FALSE WHERE (`accounts`.`id` = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-168: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` AS `model` WHERE (`model`.`id` = NULL) ORDER BY `id` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-175: -------------------------------------------------------------------------------- 1 | /* test */ DELETE FROM `models` AS `model` WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-176: -------------------------------------------------------------------------------- 1 | /* test */ CREATE UNIQUE INDEX `index_name` ON `models` (`column_name`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-181: -------------------------------------------------------------------------------- 1 | /* test */ SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-20: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-21: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-27: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = 'hello' WHERE (`model`.`id` = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-37: -------------------------------------------------------------------------------- 1 | CREATE TABLE `users` (`name` VARCHAR(255) NOT NULL DEFAULT \'unknown\') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-80: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'custom'), (43, 'custom') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-88: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `time`) VALUES (123, '1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-113: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-114: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-12: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-14: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT ON (foo) "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-185: -------------------------------------------------------------------------------- 1 | /* test */ UPDATE "models" AS "model" SET name = 'new-name' WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-65: -------------------------------------------------------------------------------- 1 | DELETE FROM "soft_deletes" AS "soft_delete" WHERE ("soft_delete"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-88: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "time") VALUES (123, '1970-01-01 00:00:00+00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-91: -------------------------------------------------------------------------------- 1 | DELETE FROM "soft_deletes" AS "soft_delete" WHERE ("soft_delete"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-113: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-114: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-12: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-14: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT ON (foo) "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-185: -------------------------------------------------------------------------------- 1 | /* test */ UPDATE "models" AS "model" SET name = 'new-name' WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-65: -------------------------------------------------------------------------------- 1 | DELETE FROM "soft_deletes" AS "soft_delete" WHERE ("soft_delete"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-88: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "time") VALUES (123, '1970-01-01 00:00:00+00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-91: -------------------------------------------------------------------------------- 1 | DELETE FROM "soft_deletes" AS "soft_delete" WHERE ("soft_delete"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-151: -------------------------------------------------------------------------------- 1 | CREATE TABLE "users" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-161: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '' WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-172: -------------------------------------------------------------------------------- 1 | DELETE FROM "models" AS "model" WHERE ("model"."id" = NULL) RETURNING * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-175: -------------------------------------------------------------------------------- 1 | /* test */ DELETE FROM "models" AS "model" WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-176: -------------------------------------------------------------------------------- 1 | /* test */ CREATE UNIQUE INDEX "index_name" ON "models" ("column_name") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-181: -------------------------------------------------------------------------------- 1 | /* test */ SELECT "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-20: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-21: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'hello'), (43, 'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-27: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = 'hello' WHERE ("model"."id" = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-71: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT) 2 | -------------------------------------------------------------------------------- /version.go: -------------------------------------------------------------------------------- 1 | package bun 2 | 3 | // Version is the current release version. 4 | func Version() string { 5 | return "1.2.16" 6 | } 7 | -------------------------------------------------------------------------------- /.prettierrc.yml: -------------------------------------------------------------------------------- 1 | trailingComma: all 2 | tabWidth: 2 3 | semi: false 4 | singleQuote: true 5 | proseWrap: always 6 | printWidth: 100 7 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-add_default: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ALTER COLUMN "budget" SET DEFAULT 100 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-add_notnull: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ALTER COLUMN "budget" SET NOT NULL 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-drop_default: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ALTER COLUMN "budget" DROP DEFAULT 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-add_default: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ALTER COLUMN "budget" SET DEFAULT 100 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-add_notnull: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ALTER COLUMN "budget" SET NOT NULL 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-drop_default: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ALTER COLUMN "budget" DROP DEFAULT 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-drop_identity: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ALTER COLUMN "id" DROP IDENTITY 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-113: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-114: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-12: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-130: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `updated_at` = NOW() WHERE (`model`.`id` = 0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-14: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT ON (foo) `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-185: -------------------------------------------------------------------------------- 1 | /* test */ UPDATE `models` AS `model` SET name = 'new-name' WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-54: -------------------------------------------------------------------------------- 1 | INSERT IGNORE INTO `models` (`id`, `str`) VALUES (DEFAULT, '') RETURNING `id` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-113: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-114: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-12: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-151: -------------------------------------------------------------------------------- 1 | CREATE TABLE "users" ("id" BIGINT NOT NULL IDENTITY, PRIMARY KEY ("id")) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-176: -------------------------------------------------------------------------------- 1 | /* test */ CREATE UNIQUE INDEX "index_name" ON "models" ("column_name") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-188: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "name" = N'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-190: -------------------------------------------------------------------------------- 1 | UPDATE "models" SET "name" = N'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-71: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" ("id" BIGINT NOT NULL IDENTITY, PRIMARY KEY ("id")) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-113: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-114: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-12: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-130: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `updated_at` = NOW() WHERE (`model`.`id` = 0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-14: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT ON (foo) `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-151: -------------------------------------------------------------------------------- 1 | CREATE TABLE `users` (`id` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-185: -------------------------------------------------------------------------------- 1 | /* test */ UPDATE `models` AS `model` SET name = 'new-name' WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-71: -------------------------------------------------------------------------------- 1 | CREATE TABLE `models` (`id` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-113: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-114: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-12: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-130: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `updated_at` = NOW() WHERE (`model`.`id` = 0) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-14: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT ON (foo) `model`.`id`, `model`.`str` FROM `models` AS `model` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-151: -------------------------------------------------------------------------------- 1 | CREATE TABLE `users` (`id` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-185: -------------------------------------------------------------------------------- 1 | /* test */ UPDATE `models` AS `model` SET name = 'new-name' WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-65: -------------------------------------------------------------------------------- 1 | DELETE FROM `soft_deletes` AS `soft_delete` WHERE (`soft_delete`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-71: -------------------------------------------------------------------------------- 1 | CREATE TABLE `models` (`id` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-91: -------------------------------------------------------------------------------- 1 | DELETE FROM `soft_deletes` AS `soft_delete` WHERE (`soft_delete`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-156: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" ("id" VARCHAR(10), "name" varchar(50), "title" VARCHAR(10)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-189: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "name" = name2, updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-32: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" ("id" BIGSERIAL NOT NULL, "str" VARCHAR, PRIMARY KEY ("id")) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-39: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX "title_idx" ON "films" ("title") INCLUDE ("director", "rating") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-63: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '', foo = 'bar' WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-156: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" ("id" VARCHAR(10), "name" varchar(50), "title" VARCHAR(10)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-189: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "name" = name2, updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-32: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" ("id" BIGSERIAL NOT NULL, "str" VARCHAR, PRIMARY KEY ("id")) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-63: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '', foo = 'bar' WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-113: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-114: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-12: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE (id = 42) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-14: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT ON (foo) "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-185: -------------------------------------------------------------------------------- 1 | /* test */ UPDATE "models" AS "model" SET name = 'new-name' WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-65: -------------------------------------------------------------------------------- 1 | DELETE FROM "soft_deletes" AS "soft_delete" WHERE ("soft_delete"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-88: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "time") VALUES (123, '1970-01-01 00:00:00+00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-91: -------------------------------------------------------------------------------- 1 | DELETE FROM "soft_deletes" AS "soft_delete" WHERE ("soft_delete"."id" = NULL) 2 | -------------------------------------------------------------------------------- /example/string-representation/README.md: -------------------------------------------------------------------------------- 1 | # String representation 2 | 3 | To run this example: 4 | 5 | ```shell 6 | go run main.go 7 | ``` 8 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-drop_foreign_key: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" DROP CONSTRAINT "genre_description" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-make_nullable: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ALTER COLUMN "director" DROP NOT NULL 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pg-rename_column: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" RENAME COLUMN "has_oscar" TO "has_awards" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-drop_foreign_key: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" DROP CONSTRAINT "genre_description" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-make_nullable: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" ALTER COLUMN "director" DROP NOT NULL 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-151: -------------------------------------------------------------------------------- 1 | CREATE TABLE `users` (`id` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-156: -------------------------------------------------------------------------------- 1 | CREATE TABLE `models` (`id` VARCHAR(10), `name` varchar(50), `title` VARCHAR(10)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-189: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `name` = name2, updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-191: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`name`) VALUES ('name1') ON CONFLICT DO UPDATE `foo` = '' 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-39: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX `title_idx` ON `films` (`title`) INCLUDE (`director`, `rating`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-63: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '', foo = 'bar' WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-71: -------------------------------------------------------------------------------- 1 | CREATE TABLE `models` (`id` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-14: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT ON (foo) "model"."id", "model"."str" FROM "models" AS "model" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-20: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("str") OUTPUT INSERTED."id" VALUES (N'hello'), (N'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-21: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("str") OUTPUT INSERTED."id" VALUES (N'hello'), (N'world') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-62: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("str", "foo") OUTPUT INSERTED."id" VALUES (N'', N'bar') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-80: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("str") OUTPUT INSERTED."id" VALUES (N'custom'), (N'custom') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-88: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("time") OUTPUT INSERTED."id" VALUES ('1970-01-01 00:00:00') 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-156: -------------------------------------------------------------------------------- 1 | CREATE TABLE `models` (`id` VARCHAR(10), `name` varchar(50), `title` VARCHAR(10)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-188: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `name` = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-189: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `name` = name2, updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-190: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `name` = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-191: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`name`) VALUES ('name1') ON CONFLICT DO UPDATE `foo` = '' 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-39: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX `title_idx` ON `films` (`title`) INCLUDE (`director`, `rating`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-63: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '', foo = 'bar' WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-156: -------------------------------------------------------------------------------- 1 | CREATE TABLE `models` (`id` VARCHAR(10), `name` varchar(50), `title` VARCHAR(10)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-169: -------------------------------------------------------------------------------- 1 | DELETE FROM `models` AS `model` WHERE (`model`.`id` = NULL) ORDER BY `id` LIMIT 1 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-188: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `name` = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-189: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `name` = name2, updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-190: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `name` = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-191: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`name`) VALUES ('name1') ON CONFLICT DO UPDATE `foo` = '' 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-39: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX `title_idx` ON `films` (`title`) INCLUDE (`director`, `rating`) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-63: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `str` = '', foo = 'bar' WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-10: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-11: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-133: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" ORDER BY "model"."str" ASC 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-138: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" ORDER BY "model"."str" ASC 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-143: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" ORDER BY "model"."str" ASC 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-146: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" ORDER BY "id" DESC LIMIT 20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-165: -------------------------------------------------------------------------------- 1 | UPDATE "accounts" AS "accounts" SET "is_active" = FALSE WHERE ("accounts"."id" = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-188: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "name" = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-190: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "name" = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-62: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str", "foo") VALUES (DEFAULT, '', 'bar') RETURNING "id" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-80: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str") VALUES (42, 'custom'), (43, 'custom') RETURNING "str" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-99: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE "model"."id" IN (1, 2) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-10: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-11: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-133: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" ORDER BY "model"."str" ASC 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-138: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" ORDER BY "model"."str" ASC 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-143: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" ORDER BY "model"."str" ASC 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-165: -------------------------------------------------------------------------------- 1 | UPDATE "accounts" AS "accounts" SET "is_active" = FALSE WHERE ("accounts"."id" = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-188: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "name" = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-190: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "name" = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-39: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX "title_idx" ON "films" ("title") INCLUDE ("director", "rating") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-62: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("id", "str", "foo") VALUES (DEFAULT, '', 'bar') RETURNING "id" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-156: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" ("id" VARCHAR(10), "name" varchar(50), "title" VARCHAR(10)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-165: -------------------------------------------------------------------------------- 1 | UPDATE "accounts" AS "accounts" SET "is_active" = FALSE WHERE ("accounts"."id" = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-188: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "name" = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-189: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "name" = name2, updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-190: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "name" = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-39: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX "title_idx" ON "films" ("title") INCLUDE ("director", "rating") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-sqlite-63: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "str" = '', foo = 'bar' WHERE ("model"."id" = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestAlterTable-pgx-rename_column: -------------------------------------------------------------------------------- 1 | ALTER TABLE "hobbies"."movies" RENAME COLUMN "has_oscar" TO "has_awards" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-10: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-11: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-135: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` USE INDEX (`ix1`, `ix2`) SET `str` = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-146: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` ORDER BY `id` DESC LIMIT 20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-188: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `name` = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-190: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` SET `name` = 'name1', updated_at = [TIME] WHERE (id = 1) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-62: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`, `foo`) VALUES (DEFAULT, '', 'bar') RETURNING `id` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-80: -------------------------------------------------------------------------------- 1 | INSERT INTO `models` (`id`, `str`) VALUES (42, 'custom'), (43, 'custom') RETURNING `str` 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mariadb-99: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE `model`.`id` IN (1, 2) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-156: -------------------------------------------------------------------------------- 1 | CREATE TABLE "models" ("id" VARCHAR(10), "name" varchar(50), "title" VARCHAR(10)) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-191: -------------------------------------------------------------------------------- 1 | INSERT INTO "models" ("name") VALUES (N'name1') ON CONFLICT DO UPDATE SET "foo" = N'' 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mssql2019-39: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX "title_idx" ON "films" ("title") INCLUDE ("director", "rating") 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-10: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-11: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-135: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` USE INDEX (`ix1`, `ix2`) SET `str` = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-145: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` FORCE INDEX (`ix1`, `ix2`) SET `str` = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-146: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` ORDER BY `id` DESC LIMIT 20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-148: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` ORDER BY `id` DESC OFFSET 20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-178: -------------------------------------------------------------------------------- 1 | /* test */ INSERT INTO `models` (`id`, `str`, `column_name`) VALUES (DEFAULT, '', value) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql5-99: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE `model`.`id` IN (1, 2) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-10: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-11: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE (`model`.`id` = NULL) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-135: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` USE INDEX (`ix1`, `ix2`) SET `str` = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-145: -------------------------------------------------------------------------------- 1 | UPDATE `models` AS `model` FORCE INDEX (`ix1`, `ix2`) SET `str` = 'hello' WHERE (id = 3) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-146: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` ORDER BY `id` DESC LIMIT 20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-148: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` ORDER BY `id` DESC OFFSET 20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-178: -------------------------------------------------------------------------------- 1 | /* test */ INSERT INTO `models` (`id`, `str`, `column_name`) VALUES (DEFAULT, '', value) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-mysql8-99: -------------------------------------------------------------------------------- 1 | SELECT `model`.`id`, `model`.`str` FROM `models` AS `model` WHERE `model`.`id` IN (1, 2) 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-117: -------------------------------------------------------------------------------- 1 | SELECT "soft_delete"."id", "soft_delete"."deleted_at" FROM "soft_deletes" AS "soft_delete" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-130: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "updated_at" = NOW() WHERE ("model"."id" = 0) RETURNING * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-148: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" ORDER BY "id" DESC OFFSET 20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-68: -------------------------------------------------------------------------------- 1 | SELECT "soft_delete"."id", "soft_delete"."deleted_at" FROM "soft_deletes" AS "soft_delete" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pg-94: -------------------------------------------------------------------------------- 1 | SELECT "soft_delete"."id", "soft_delete"."deleted_at" FROM "soft_deletes" AS "soft_delete" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-117: -------------------------------------------------------------------------------- 1 | SELECT "soft_delete"."id", "soft_delete"."deleted_at" FROM "soft_deletes" AS "soft_delete" 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-130: -------------------------------------------------------------------------------- 1 | UPDATE "models" AS "model" SET "updated_at" = NOW() WHERE ("model"."id" = 0) RETURNING * 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-146: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" ORDER BY "id" DESC LIMIT 20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-148: -------------------------------------------------------------------------------- 1 | SELECT "model"."id", "model"."str" FROM "models" AS "model" ORDER BY "id" DESC OFFSET 20 2 | -------------------------------------------------------------------------------- /internal/dbtest/testdata/snapshots/TestQuery-pgx-68: -------------------------------------------------------------------------------- 1 | SELECT "soft_delete"."id", "soft_delete"."deleted_at" FROM "soft_deletes" AS "soft_delete" 2 | --------------------------------------------------------------------------------