|
| 1 | +// Jest Snapshot v1, https://goo.gl/fbAQLP |
| 2 | + |
| 3 | +exports[`sequelizeFindByCursor does not include extra PK in ORDER BY if it’s already present: nodes 1`] = ` |
| 4 | +Array [ |
| 5 | + Object { |
| 6 | + "firstName": "Alan", |
| 7 | + "id": 5, |
| 8 | + "lastName": "LastName", |
| 9 | + }, |
| 10 | + Object { |
| 11 | + "firstName": "Bernard", |
| 12 | + "id": 4, |
| 13 | + "lastName": "LastName", |
| 14 | + }, |
| 15 | + Object { |
| 16 | + "firstName": "Cedric", |
| 17 | + "id": 3, |
| 18 | + "lastName": "Anderson", |
| 19 | + }, |
| 20 | + Object { |
| 21 | + "firstName": "Cedric", |
| 22 | + "id": 2, |
| 23 | + "lastName": "Brown", |
| 24 | + }, |
| 25 | + Object { |
| 26 | + "firstName": "Dimitri", |
| 27 | + "id": 6, |
| 28 | + "lastName": "LastName", |
| 29 | + }, |
| 30 | + Object { |
| 31 | + "firstName": "Dimitri", |
| 32 | + "id": 1, |
| 33 | + "lastName": "LastName", |
| 34 | + }, |
| 35 | +] |
| 36 | +`; |
| 37 | + |
| 38 | +exports[`sequelizeFindByCursor does not include extra PK in ORDER BY if it’s already present: query 1`] = `"Executing (default): SELECT \\"users\\".* FROM (SELECT \\"first_name\\" AS \\"firstName\\", \\"last_name\\" AS \\"lastName\\", \\"id\\" FROM \\"users\\" AS \\"users\\" ORDER BY \\"users\\".\\"first_name\\" ASC, \\"users\\".\\"last_name\\" ASC, \\"users\\".\\"id\\" DESC LIMIT 11) AS \\"users\\" ORDER BY \\"firstName\\" ASC, \\"lastName\\" ASC, \\"users\\".\\"id\\" DESC;"`; |
| 39 | + |
| 40 | +exports[`sequelizeFindByCursor includes PK in ORDER BY to ensures constant order: nodes 1`] = ` |
| 41 | +Array [ |
| 42 | + Object { |
| 43 | + "firstName": "Alan", |
| 44 | + "id": 5, |
| 45 | + "lastName": "LastName", |
| 46 | + }, |
| 47 | + Object { |
| 48 | + "firstName": "Bernard", |
| 49 | + "id": 4, |
| 50 | + "lastName": "LastName", |
| 51 | + }, |
| 52 | + Object { |
| 53 | + "firstName": "Cedric", |
| 54 | + "id": 3, |
| 55 | + "lastName": "Anderson", |
| 56 | + }, |
| 57 | + Object { |
| 58 | + "firstName": "Cedric", |
| 59 | + "id": 2, |
| 60 | + "lastName": "Brown", |
| 61 | + }, |
| 62 | + Object { |
| 63 | + "firstName": "Dimitri", |
| 64 | + "id": 1, |
| 65 | + "lastName": "LastName", |
| 66 | + }, |
| 67 | + Object { |
| 68 | + "firstName": "Dimitri", |
| 69 | + "id": 6, |
| 70 | + "lastName": "LastName", |
| 71 | + }, |
| 72 | +] |
| 73 | +`; |
| 74 | + |
| 75 | +exports[`sequelizeFindByCursor includes PK in ORDER BY to ensures constant order: query 1`] = `"Executing (default): SELECT \\"users\\".* FROM (SELECT \\"first_name\\" AS \\"firstName\\", \\"last_name\\" AS \\"lastName\\", \\"id\\" FROM \\"users\\" AS \\"users\\" ORDER BY \\"users\\".\\"first_name\\" ASC, \\"users\\".\\"last_name\\" ASC, \\"users\\".\\"id\\" ASC LIMIT 11) AS \\"users\\" ORDER BY \\"firstName\\" ASC, \\"lastName\\" ASC, \\"users\\".\\"id\\" ASC;"`; |
| 76 | + |
| 77 | +exports[`sequelizeFindByCursor supports filtering: nodes 1`] = ` |
| 78 | +Array [ |
| 79 | + Object { |
| 80 | + "firstName": "Dimitri", |
| 81 | + "id": 1, |
| 82 | + "lastName": "LastName", |
| 83 | + }, |
| 84 | + Object { |
| 85 | + "firstName": "Dimitri", |
| 86 | + "id": 6, |
| 87 | + "lastName": "LastName", |
| 88 | + }, |
| 89 | +] |
| 90 | +`; |
| 91 | + |
| 92 | +exports[`sequelizeFindByCursor supports filtering: query 1`] = `"Executing (default): SELECT \\"users\\".* FROM (SELECT \\"first_name\\" AS \\"firstName\\", \\"last_name\\" AS \\"lastName\\", \\"id\\" FROM \\"users\\" AS \\"users\\" WHERE (\\"users\\".\\"birth_date\\" >= '1990-01-01' AND (\\"users\\".\\"first_name\\" > 'Bernard' OR (\\"users\\".\\"first_name\\" = 'Bernard' AND (\\"users\\".\\"last_name\\" > 'LastName' OR (\\"users\\".\\"last_name\\" = 'LastName' AND \\"users\\".\\"id\\" > 4))))) ORDER BY \\"users\\".\\"first_name\\" ASC, \\"users\\".\\"last_name\\" ASC, \\"users\\".\\"id\\" ASC LIMIT 11) AS \\"users\\" ORDER BY \\"firstName\\" ASC, \\"lastName\\" ASC, \\"users\\".\\"id\\" ASC;"`; |
| 93 | + |
| 94 | +exports[`sequelizeFindByCursor supports filtering: query 2`] = `"Executing (default): SELECT \\"users\\".* FROM (SELECT \\"first_name\\" AS \\"firstName\\", \\"last_name\\" AS \\"lastName\\", \\"id\\" FROM \\"users\\" AS \\"users\\" WHERE (\\"users\\".\\"birth_date\\" >= '1990-01-01' AND (\\"users\\".\\"first_name\\" < 'Bernard' OR (\\"users\\".\\"first_name\\" = 'Bernard' AND (\\"users\\".\\"last_name\\" < 'LastName' OR (\\"users\\".\\"last_name\\" = 'LastName' AND \\"users\\".\\"id\\" < 4))))) ORDER BY \\"users\\".\\"first_name\\" DESC, \\"users\\".\\"last_name\\" DESC, \\"users\\".\\"id\\" DESC LIMIT 1) AS \\"users\\" ORDER BY \\"firstName\\" DESC, \\"lastName\\" DESC, \\"users\\".\\"id\\" DESC;"`; |
| 95 | + |
| 96 | +exports[`sequelizeFindByCursor supports returning the first x elements after another cursor: nodes 1`] = ` |
| 97 | +Array [ |
| 98 | + Object { |
| 99 | + "firstName": "Cedric", |
| 100 | + "id": 2, |
| 101 | + "lastName": "Brown", |
| 102 | + }, |
| 103 | + Object { |
| 104 | + "firstName": "Dimitri", |
| 105 | + "id": 1, |
| 106 | + "lastName": "LastName", |
| 107 | + }, |
| 108 | +] |
| 109 | +`; |
| 110 | + |
| 111 | +exports[`sequelizeFindByCursor supports returning the first x elements before another cursor: nodes 1`] = ` |
| 112 | +Array [ |
| 113 | + Object { |
| 114 | + "firstName": "Alan", |
| 115 | + "id": 5, |
| 116 | + "lastName": "LastName", |
| 117 | + }, |
| 118 | + Object { |
| 119 | + "firstName": "Bernard", |
| 120 | + "id": 4, |
| 121 | + "lastName": "LastName", |
| 122 | + }, |
| 123 | +] |
| 124 | +`; |
| 125 | + |
| 126 | +exports[`sequelizeFindByCursor supports returning the first x elements of the set: nodes 1`] = ` |
| 127 | +Array [ |
| 128 | + Object { |
| 129 | + "firstName": "Alan", |
| 130 | + "id": 5, |
| 131 | + "lastName": "LastName", |
| 132 | + }, |
| 133 | + Object { |
| 134 | + "firstName": "Bernard", |
| 135 | + "id": 4, |
| 136 | + "lastName": "LastName", |
| 137 | + }, |
| 138 | +] |
| 139 | +`; |
| 140 | + |
| 141 | +exports[`sequelizeFindByCursor supports returning the last x elements after another cursor: nodes 1`] = ` |
| 142 | +Array [ |
| 143 | + Object { |
| 144 | + "firstName": "Dimitri", |
| 145 | + "id": 1, |
| 146 | + "lastName": "LastName", |
| 147 | + }, |
| 148 | + Object { |
| 149 | + "firstName": "Dimitri", |
| 150 | + "id": 6, |
| 151 | + "lastName": "LastName", |
| 152 | + }, |
| 153 | +] |
| 154 | +`; |
| 155 | + |
| 156 | +exports[`sequelizeFindByCursor supports returning the last x elements before another cursor: nodes 1`] = ` |
| 157 | +Array [ |
| 158 | + Object { |
| 159 | + "firstName": "Cedric", |
| 160 | + "id": 3, |
| 161 | + "lastName": "Anderson", |
| 162 | + }, |
| 163 | + Object { |
| 164 | + "firstName": "Cedric", |
| 165 | + "id": 2, |
| 166 | + "lastName": "Brown", |
| 167 | + }, |
| 168 | +] |
| 169 | +`; |
| 170 | + |
| 171 | +exports[`sequelizeFindByCursor supports returning the last x elements of the set: nodes 1`] = ` |
| 172 | +Array [ |
| 173 | + Object { |
| 174 | + "firstName": "Dimitri", |
| 175 | + "id": 1, |
| 176 | + "lastName": "LastName", |
| 177 | + }, |
| 178 | + Object { |
| 179 | + "firstName": "Dimitri", |
| 180 | + "id": 6, |
| 181 | + "lastName": "LastName", |
| 182 | + }, |
| 183 | +] |
| 184 | +`; |
0 commit comments