var Queries = {
	"Select": {
		"User" : {
			"type": "select",
			"sql": "SELECT * FROM user WHERE id = :id",
			"bindParam": [{
				"type": "int",
				"tag": ":id",
				"value": 0
			}]
		},
		"AllUsers" : {
			"type": "select",
			"sql": "SELECT * FROM user"
		},		
		"UserFiles" : {
			"AllIds" : {
				"type": "select",
				"sql": "SELECT ID FROM userfiles WHERE owner = :owner",
				"bindParam": [{
					"type": "int",
					"tag": ":owner",
					"value": 0
				}]
			},
			"Exif" : {
				"type": "select",
				"sql": "SELECT * FROM userfileexifs WHERE FileID = :id",
				"bindParam": [{
					"type": "int",
					"tag": ":id",
					"value": 0
				}]
			},
			"TotalSize" : {
				"type": "select",
				"sql": "SELECT sum(size) as TotalSize From userfiles uf WHERE uf.owner = :owner",
				"bindParam": [{
					"type": "int",
					"tag": ":owner",
					"value": 0
				}]
			},
			"TotalSizeThumbnails" : {
				"type": "select",
				"sql": "SELECT (sum(length(binaryContent64)) + sum(length(binaryContent128)) + sum(length(binaryContent256))) as TotalSize From userfiles uf WHERE uf.owner = :owner",
				"bindParam": [{
					"type": "int",
					"tag": ":owner",
					"value": 0
				}]
			},
			"Data" : {
				"type": "select",
				"sql": "SELECT binaryContent64, binaryContent128, binaryContent256, basename, size, caption, created, private, ufe.Id as ExifID FROM userfiles uf INNER JOIN userfileexifs ufe ON uf.id = ufe.fileid WHERE uf.id = :id",
				"bindParam": [{
					"type": "int",
					"tag": ":id",
					"value": 0
				}]
			},
			"Thumbnails" : {
				"type": "select",
				"sql": "SELECT binaryContent64, binaryContent128, binaryContent256, basename, MimeType FROM userfiles uf INNER JOIN userfileexifs ufe ON uf.id = ufe.fileid WHERE uf.id = :id",
				"bindParam": [{
					"type": "int",
					"tag": ":id",
					"value": 0
				}]
			}
		}
	},
	"Insert": {
		"Error" : {
			"type": "insert",
			"sql": "INSERT INTO test (text, text2, zahl) VALUES (:text, :text2, :zahl)",
			"bindParam": [{
				"type": "string",
				"tag": ":text",
				"value": 0,
				"size": 128 
			},
			{
				"type": "string",
				"tag": ":text2",
				"value": 0,
				"size": 512
			},
			{
				"type": "int",
				"tag": ":zahl",
				"value": 0
			}]
		}
	},
	"Update": {
	},
	"Delete": {
	}
}
