Database explorer join using composite key

peterf
Member | 1
+
0
-

Hi,
Is it possible to perform join using composite key using database explorer ?
Table A has primary key which is composite and table B has reference to it.

Thanks

m.brecher
Generous Backer | 870
+
0
-

perform join using composite key using database explorer

I don't think that composite key can be used instead of simple one-column primary key. I had a brief look into the documentation of https://api.nette.org/…entions.html and the corresponding source code of DiscoveredConventions and there is no evidence that composite key is supported for join database queries.

But I'am not an experienced user of Nette Explorer at all, so would be useful, if somebody with deep knowledge of Nette Explorer would confirm or reject this my answer.

Creator13
Member | 18
+
0
-

Try this example. You recieve ActiveRow of category table.

		$categoryActiveRow = $this->explorer->table('mb_product_category')
			->where('product_id?', $productId)
			->limit(1)
			->fetch()
			->ref('category', 'category_id');