src/bbn/db.php
public function get_unique_keys($table): array
  {
    $fields = [[]];
    if ( $ks = $this->get_keys($table) ){
      foreach ( $ks['keys'] as $k ){
        if ( $k['unique'] ){
          $fields[] = $k['columns'];
        }
      }
    }
    return array_merge(...$fields);
  }
public function get_unique_keys($table): array
  {
    $fields = [[]];
    if ( $ks = $this->get_keys($table) ){
      foreach ( $ks['keys'] as $k ){
        if ( $k['unique'] ){
          $fields[] = $k['columns'];
        }
      }
    }
    return array_merge(...$fields);
  }
public function get_unique_keys ( $ table ) : array { $ fields = [ [ ] ] ; if ( $ ks = $ this -> get_keys ( $ table ) ) { foreach ( $ ks [ 'keys' ] as $ k ) { if ( $ k [ 'unique' ] ) { $ fields [ ] = $ k [ 'columns' ] ; } } } return array_merge ( ... $ fields ) ; }
Return the unique keys of a table as a numeric array.

```php
\bbn\x::dump($db->get_unique_keys('table_users'));
// (array) ["userid", "userdataid"]
```

@param string $table The table's name
@return array
Return the unique keys of a table as a numeric array .