mirror of
				https://github.com/TaKO8Ki/gobang.git
				synced 2021-09-19 22:32:56 +03:00 
			
		
		
		
	Fix SQL syntax error in PostgreSQL get_record (#101)
				
					
				
			* fix SQL syntax error * v0.1.0-alpha.4 * revert database-tree version
This commit is contained in:
		
							
								
								
									
										2
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							| @@ -503,7 +503,7 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "gobang" | ||||
| version = "0.1.0-alpha.3" | ||||
| version = "0.1.0-alpha.4" | ||||
| dependencies = [ | ||||
|  "anyhow", | ||||
|  "async-trait", | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| [package] | ||||
| name = "gobang" | ||||
| version = "0.1.0-alpha.3" | ||||
| version = "0.1.0-alpha.4" | ||||
| authors = ["Takayuki Maeda <takoyaki0316@gmail.com>"] | ||||
| edition = "2018" | ||||
| license = "MIT" | ||||
|   | ||||
| @@ -44,7 +44,7 @@ $ brew install tako8ki/tap/gobang | ||||
| If you already have a Rust environment set up, you can use the `cargo install` command: | ||||
|  | ||||
| ``` | ||||
| $ cargo install --version 0.1.0-alpha.3 gobang | ||||
| $ cargo install --version 0.1.0-alpha.4 gobang | ||||
| ``` | ||||
|  | ||||
| ### Using a release binary (Linux/macOS/Windows) | ||||
|   | ||||
| @@ -207,7 +207,7 @@ impl Pool for PostgresPool { | ||||
|     ) -> anyhow::Result<(Vec<String>, Vec<Vec<String>>)> { | ||||
|         let query = if let Some(filter) = filter.as_ref() { | ||||
|             format!( | ||||
|                 r#"SELECT * FROM "{database}""{table_schema}"."{table}" WHERE {filter} LIMIT {page}, {limit}"#, | ||||
|                 r#"SELECT * FROM "{database}"."{table_schema}"."{table}" WHERE {filter} LIMIT {limit} OFFSET {page}"#, | ||||
|                 database = database.name, | ||||
|                 table = table.name, | ||||
|                 filter = filter, | ||||
| @@ -217,7 +217,7 @@ impl Pool for PostgresPool { | ||||
|             ) | ||||
|         } else { | ||||
|             format!( | ||||
|                 r#"SELECT * FROM "{database}"."{table_schema}"."{table}" limit {limit} offset {page}"#, | ||||
|                 r#"SELECT * FROM "{database}"."{table_schema}"."{table}" LIMIT {limit} OFFSET {page}"#, | ||||
|                 database = database.name, | ||||
|                 table = table.name, | ||||
|                 table_schema = table.schema.clone().unwrap_or_else(|| "public".to_string()), | ||||
| @@ -441,7 +441,7 @@ impl PostgresPool { | ||||
|     ) -> anyhow::Result<Vec<serde_json::Value>> { | ||||
|         let query = if let Some(filter) = filter { | ||||
|             format!( | ||||
|                 r#"SELECT to_json({table}.*) FROM "{database}""{table_schema}"."{table}" WHERE {filter} LIMIT {page}, {limit}"#, | ||||
|                 r#"SELECT to_json({table}.*) FROM "{database}"."{table_schema}"."{table}" WHERE {filter} LIMIT {limit} OFFSET {page}"#, | ||||
|                 database = database.name, | ||||
|                 table = table.name, | ||||
|                 filter = filter, | ||||
| @@ -451,7 +451,7 @@ impl PostgresPool { | ||||
|             ) | ||||
|         } else { | ||||
|             format!( | ||||
|                 r#"SELECT to_json({table}.*) FROM "{database}"."{table_schema}"."{table}" limit {limit} offset {page}"#, | ||||
|                 r#"SELECT to_json({table}.*) FROM "{database}"."{table_schema}"."{table}" LIMIT {limit} OFFSET {page}"#, | ||||
|                 database = database.name, | ||||
|                 table = table.name, | ||||
|                 table_schema = table.schema.clone().unwrap_or_else(|| "public".to_string()), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Takayuki Maeda
					Takayuki Maeda