/* gdadata-5.0.vapi generated by valac 0.26.2, do not modify. */

[CCode (gir_namespace = "GdaData", gir_version = "5.0")]
namespace GdaData {
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public class Catalog : GLib.Object, GdaData.DbObject, GdaData.DbNamedObject, GdaData.DbCatalog {
		public Catalog ();
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public class DataBase : GLib.Object, GdaData.DbObject, GdaData.DbNamedObject, GdaData.DbCollection {
		public Gee.HashMap<string,GdaData.DbSchema> _schemas;
		public DataBase ();
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public class Field : GLib.Object, GdaData.DbField {
		public Field (string col_name, GdaData.DbField.Attribute attr);
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public class FieldInfo : GLib.Object, GdaData.DbFieldInfo {
		public FieldInfo ();
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public class Record : GLib.Object, GdaData.DbObject, Gee.Comparable<GdaData.DbRecord>, GdaData.DbRecord {
		protected Gee.HashMap<string,GdaData.DbField> _fields;
		protected Gee.HashMap<string,GdaData.DbField> _keys;
		public Record ();
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public class RecordCollection : Gee.AbstractCollection<GdaData.DbRecord>, GdaData.DbRecordCollection {
		public RecordCollection (Gda.DataModel m, GdaData.DbTable table);
		public override bool add (GdaData.DbRecord item);
		public override void clear ();
		public override bool contains (GdaData.DbRecord item);
		public override Gee.Iterator<GdaData.DbRecord> iterator ();
		public override bool remove (GdaData.DbRecord item);
		public string to_string ();
		public override bool read_only { get; }
		public override int size { get; }
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public class RecordCollectionIterator : GLib.Object, Gee.Traversable<GdaData.DbRecord>, Gee.Iterator<GdaData.DbRecord> {
		public RecordCollectionIterator (Gda.DataModelIter iter, GdaData.DbTable table);
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public class Schema : GLib.Object, GdaData.DbObject, GdaData.DbNamedObject, GdaData.DbSchema {
		public Gee.HashMap<string,GdaData.DbTable> _tables;
		public Schema ();
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public class Table : GLib.Object, GdaData.DbObject, GdaData.DbNamedObject, GdaData.DbTable {
		protected Gee.HashMap<string,GdaData.DbTable> _depends;
		protected Gee.HashMap<string,GdaData.DbFieldInfo> _fields;
		protected string _name;
		protected GdaData.DbRecordCollection _records;
		protected Gee.HashMap<string,GdaData.DbTable> _referenced;
		protected GdaData.DbTable.TableType _type;
		public Table ();
		public Table.with_fields_info (Gee.HashMap<string,GdaData.DbFieldInfo> fields);
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public interface DbCatalog : GLib.Object, GdaData.DbObject, GdaData.DbNamedObject {
		public abstract Gee.Collection<GdaData.DbSchema> shemas { get; set; }
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public interface DbCollection : GLib.Object, GdaData.DbObject, GdaData.DbNamedObject {
		public abstract Gee.Collection<GdaData.DbSchema> schemas { owned get; }
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public interface DbField : GLib.Object {
		[Flags]
		public enum Attribute {
			NONE,
			IS_NULL,
			CAN_BE_NULL,
			IS_DEFAULT,
			CAN_BE_DEFAULT,
			IS_UNCHANGED,
			ACTIONS_SHOWN,
			DATA_NON_VALID,
			HAS_VALUE_ORIG,
			NO_MODIF,
			UNUSED;
			public static GdaData.DbField.Attribute[] items ();
			public string to_string ();
		}
		public virtual bool equal (GdaData.DbField field);
		public virtual string to_string ();
		public static GLib.Value? value_from_string (string as_string, GLib.Type type);
		public abstract GdaData.DbField.Attribute attributes { get; }
		public abstract string column_name { get; }
		public abstract string name { get; set; }
		public abstract GLib.Value? value { get; set; }
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public interface DbFieldInfo : GLib.Object {
		public class ForeignKey {
			public enum Match {
				NONE,
				FULL,
				PARTIAL;
				public static GdaData.DbFieldInfo.ForeignKey.Match[] items ();
				public string to_string ();
				public static GdaData.DbFieldInfo.ForeignKey.Match from_string (string str);
			}
			public enum Rule {
				NONE,
				CASCADE,
				SET_NULL,
				SET_DEFAULT,
				RESTRICT,
				NO_ACTION;
				public static GdaData.DbFieldInfo.ForeignKey.Rule[] items ();
				public string to_string ();
				public static GdaData.DbFieldInfo.ForeignKey.Rule from_string (string? str);
			}
			public ForeignKey ();
			public bool equal (GdaData.DbFieldInfo.ForeignKey fkey);
			public string to_string ();
			public GdaData.DbFieldInfo.ForeignKey.Rule delete_rule { get; set; }
			public GdaData.DbFieldInfo.ForeignKey.Match match { get; set; }
			public string name { get; set; }
			public Gee.ArrayList<string> refcol { get; set; }
			public string refname { get; set; }
			public GdaData.DbTable reftable { get; set; }
			public GdaData.DbFieldInfo.ForeignKey.Rule update_rule { get; set; }
		}
		[Flags]
		public enum Attribute {
			NONE,
			PRIMARY_KEY,
			UNIQUE,
			FOREIGN_KEY,
			CHECK,
			HAVE_DEFAULT,
			CAN_BE_NULL,
			AUTO_INCREMENT;
			public static GdaData.DbFieldInfo.Attribute[] items ();
			public string to_string ();
			public static GdaData.DbFieldInfo.Attribute from_string (string str);
		}
		public virtual bool compatible (GdaData.DbFieldInfo field);
		public virtual bool equivalent (GdaData.DbFieldInfo field);
		public virtual string to_string ();
		public abstract GdaData.DbFieldInfo.Attribute attributes { get; set; }
		public abstract GLib.Value? default_value { get; set; }
		public abstract string desc { get; set; }
		public abstract GdaData.DbFieldInfo.ForeignKey fkey { get; set; }
		public abstract string name { get; set; }
		public abstract int ordinal { get; set; }
		public abstract int precision { get; set; }
		public abstract int scale { get; set; }
		public abstract GLib.Type value_type { get; set; }
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public interface DbNamedObject : GLib.Object, GdaData.DbObject {
		public abstract string name { get; set; }
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public interface DbObject : GLib.Object {
		public abstract void append () throws GLib.Error;
		public abstract void drop (bool cascade) throws GLib.Error;
		public abstract void save () throws GLib.Error;
		public abstract void update () throws GLib.Error;
		public abstract Gda.Connection connection { get; set; }
		public abstract bool update_meta { get; set; }
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public interface DbRecord : GLib.Object, GdaData.DbObject, Gee.Comparable<GdaData.DbRecord> {
		public virtual void copy (GdaData.DbRecord record) throws GLib.Error;
		public virtual bool equal (GdaData.DbRecord record) throws GLib.Error;
		public abstract GdaData.DbField get_field (string name) throws GLib.Error;
		public abstract GdaData.DbField get_key (string name) throws GLib.Error;
		public abstract unowned GLib.Value? get_value (string name) throws GLib.Error;
		public abstract void set_field (GdaData.DbField field) throws GLib.Error;
		public abstract void set_field_value (string field, GLib.Value? val) throws GLib.Error;
		public abstract void set_key (GdaData.DbField field) throws GLib.Error;
		public abstract void set_key_value (string field, GLib.Value? val) throws GLib.Error;
		public abstract string to_string ();
		public abstract Gee.Collection<GdaData.DbField> fields { owned get; }
		public abstract Gee.Collection<GdaData.DbField> keys { owned get; }
		public abstract GdaData.DbTable table { get; set construct; }
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public interface DbRecordCollection : GLib.Object, Gee.Traversable<GdaData.DbRecord>, Gee.Iterable<GdaData.DbRecord>, Gee.Collection<GdaData.DbRecord> {
		public abstract Gda.Connection connection { get; set; }
		public abstract Gda.DataModel model { get; }
		public abstract GdaData.DbTable table { get; }
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public interface DbSchema : GLib.Object, GdaData.DbObject, GdaData.DbNamedObject {
		public abstract GdaData.DbCatalog catalog { get; set; }
		public abstract Gee.Collection<GdaData.DbTable> tables { owned get; }
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public interface DbTable : GLib.Object, GdaData.DbObject, GdaData.DbNamedObject {
		public enum TableType {
			NONE,
			BASE_TABLE,
			VIEW,
			LOCAL_TEMPORARY,
			SYSTEM_TABLE,
			GLOBAL_TEMPORARY,
			ALIAS,
			SYNONYM;
			public static GdaData.DbTable.TableType from_string (string str);
		}
		public virtual bool compatible (GdaData.DbTable table);
		public virtual bool equivalent (GdaData.DbTable table);
		public abstract GdaData.DbFieldInfo get_field (string name) throws GLib.Error;
		public abstract void set_field (GdaData.DbFieldInfo field) throws GLib.Error;
		public abstract GdaData.DbCatalog catalog { get; set; }
		public abstract Gee.Collection<GdaData.DbTable> depends { owned get; }
		public abstract Gee.Collection<GdaData.DbFieldInfo> fields { owned get; }
		public abstract Gee.Collection<GdaData.DbFieldInfo> primary_keys { owned get; }
		public abstract Gee.Collection<GdaData.DbRecord> records { owned get; }
		public abstract Gee.Collection<GdaData.DbTable> referenced { owned get; }
		public abstract GdaData.DbSchema schema { get; set; }
		public abstract GdaData.DbTable.TableType table_type { get; set; }
	}
	[CCode (cheader_filename = "libgda/data/libgdadata.h")]
	public errordomain DbObjectError {
		APPEND,
		UPDATE,
		SAVE,
		DROP
	}
}
